File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes whizlab question for SCJP1.5 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 "whizlab question for SCJP1.5" Watch "whizlab question for SCJP1.5" New topic

whizlab question for SCJP1.5

Nazeer Ahmed

Joined: Aug 05, 2006
Posts: 21

In whizlabs fpr SCJP1.5 i got a question

Vector<Integer> vector1= new Vector<Integer>();
Vector<Double> vector2= new Vector<Double>();
System.out.println("== "+ vector1.getClass()==vector2.getClass());
System.out.println("equal "+ vector1.equals(vector2));

where the correct answer put up as

But when i execute the same program i am getting compile time error as

incomparable types: java.lang.String and java.lang.Class <capture of ? extends java.util.Vector>

Please clarify about the program output...

Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
See comment in code:

[ December 17, 2006: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Nazeer Ahmed

Joined: Aug 05, 2006
Posts: 21
I agree. Here's the link:
subject: whizlab question for SCJP1.5
It's not a secret anymore!