This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Generic  Classes using ? 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 "Generic  Classes using ?" Watch "Generic  Classes using ?" New topic
Author

Generic Classes using ?

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

As given in the THREADS notes by By:
Prithvi Sehgal/Beenish Zaidi the following code should Compiles fine
But,it doesnot compile .






OCPJP 6.0 93%
OCPJWCD 5.0 98%
Arjun Srivastava
Ranch Hand

Joined: Jun 23, 2010
Posts: 432

mohitkumar gupta wrote:


you cannot use wildcards in class and method declaration,it has been specified specifically in the book.


SCJP 6 | FB : Java Certifications-Help. | India Against Corruption
Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 446
    
    1

I think you are mixing up generics and wildcards
if you want to use generics then the syntax for that is



and if you want to use wild cards then we can write as follows



SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Thanks
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Generic Classes using ?
 
It's not a secret anymore!