Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is this declaration?

 
Dan Nugent
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please help me read this and explain what it does?

public void buildPDFWindow(Collection<PdfPTable> windowList, etc...

Thank you
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dan Nugent:
Could you please help me read this and explain what it does?

public void buildPDFWindow(Collection<PdfPTable> windowList, etc...

Thank you


It is a method definition that accepts a Collection of PdfTable objects and obviously other arguments according to your , etc. Defining the type of object a Collection accepts as in <PdfTable> is called Generics and it was added to Java in 1.5. When the source is compiled the compiler will check that only PdfTable objects have been added to any Collection defined this way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic