Forums Register Login

whizlab question for SCJP1.5

+Pie Number of slices to send: Send
Hi

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
true
true

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...

Thanks.
+Pie Number of slices to send: Send
See comment in code:

[ December 17, 2006: Message edited by: Barry Gaunt ]
+Pie Number of slices to send: Send
oops
His brain is the size of a cherry pit! About the size of this ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 700 times.
Similar Threads
SCJP1.5
Mouse listener question
scjp1.5
Two Empty Generic Class Comparison
comparing and appending two vectors
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:43:05.