This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Collection generics method types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Collection generics method types" Watch "Collection generics method types" New topic
Author

Collection generics method types

Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 423
Hi, How to call the following 3 methods in Collection generics. These look typical and hard to understand.


OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 4094
    
  18



Where did you get these methods? I think the last one is illegal.


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 423
Thanks Stephan. I am clear now. These are some samples that I got from net.
Rohit Ramachandran
Ranch Hand

Joined: Oct 05, 2010
Posts: 102
Why is the third one illegal?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 4094
    
  18

Hmmm I tried the third method, and it compiled just fine. I have no clue how to call it though. It looks like a circular reference, so I assumed the compiled wouldn't allow it.

If someone knows, please give an example.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

The third one can be called like this:


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Collection generics method types
 
It's not a secret anymore!