wood burning stoves
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Generics Whizlabs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Generics Whizlabs" Watch "Generics Whizlabs" New topic

Generics Whizlabs

Saibabaa Pragada
Ranch Hand

Joined: Oct 24, 2010
Posts: 162
This is Whizlabs questions. Could you please advice on the following comments ?
Joe carco
Ranch Hand

Joined: Apr 14, 2009
Posts: 82
what is it you want to know? what exactly is your question??
Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 446

Saibabaa Pragada wrote:

above method argument means that we can pass any list that extends String but we cannot add elements to it

Saibabaa Pragada wrote:

and above method means that we can pass list of anything that is super type of String and we can ADD either String
or subype of String
(subtype of String is not possible as it is final class)

this may be a little difficult to understand so consider following example

hope this helps

SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right
I agree. Here's the link: http://aspose.com/file-tools
subject: Generics Whizlabs
It's not a secret anymore!