• Post Reply Bookmark Topic Watch Topic
  • New Topic

Description for code  RSS feed

 
Alice Hampton
Ranch Hand
Posts: 217
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to create a load of code samples with descriptions. There is one I can't think of what to put for it's description, does anyone have a good explanation for this?




 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The line you posted above is an incomplete declaration of a static member variable of type List<Class<?>> (a List of Class<?> objects).

It should be followed by a variable name and optionally an initializer, and a semi-colon. For example:

or:


For detailed explanations:
- of what private means: Controlling Access to Members of a Class
- of what static means: Understanding Class Members
- collections such as List: Trail: Collections
- generics: Lesson: Generics
- class java.lang.Class (<- click for API documentation)
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alice Hampton wrote:There is one I can't think of what to put for it's description, does anyone have a good explanation for this?

I'm not quite sure what you want here, but the field defines a List of Java Class objects of unknown type. In this case, the '?' means that you can put any Java Class into the List, but when you come to get it back out, all you will know is that it's a Class; you won't know it's actual type.

HIH

Winston
 
Alice Hampton
Ranch Hand
Posts: 217
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Jesper - yeah thanks I have it like you suggested I already knew I was just trying to point out the part I was wanting to focus on

@Winston - Thanks for the explanation, that's exactly what I was looking for!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!