File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 422
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: 3647
    
  16



Where did you get these methods? I think the last one is illegal.
Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
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: 3647
    
  16

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