hi
i have been doing some mock exams and tried this site
http://valiveru.tripod.com/java/jvaltest.html
the questions looked interesting however when i looked at the answers they were giving
some of them didn't look right
so i want to show them here and see if i don't understand something or that some of the answers they were giving are wrong
and i am not mad.
if some sites do have errors in their answers is it beneficial using them because it will confuse you more
so how can i know which sites are good for learning to
SCJP and sites that are not that great.
1.
Select the assignments that compile without giving error
their answer is B,C,D,E - i thought that B was not legal and i checked in eclipse and B gives compile error so whats that about.
2.
Which of the following are valid constructors of the
class named 'SubClass' which extends a class with default constructor
their answer is A,C -- A doesn't seam to be logical(because if you already defined constructor with arguments the empty one will not be valid) and i checked and A gives compile error
3.
Select the valid primitive assignments of the following.
their answer is A,B -- A gives compile error as it should
4.
Which of the following is valid 'if' statement
their answer C,D -- clearly and i checked B is ok also
5.
Select the code segments(assuming is part of valid class) below that compile and run correctly with output : We are Equal
their answer D,F - Checked C also and compiles runs and works like a charm
6.
If you want to create
java GUI application using AWT, you constructed a frame calling
Frame f = new Frame();
What methods you need to call on the Frame f to make it visible.
their answer C - i checked and there is no function setSize(boolean) for Frame and it gives compile error in eclipse
7.
Given the following code segments, select the ones that are legal.
their answer B,E -- checked F and it works and regarding B it does work but why 'c =c+i' (C char i integer) does not compile and 'c+=i' does and work
8.
How many
String objects are created when we run the following code.
A. 1
B. 2
C. 3
D. 4
E. We can't say.
their answer C - Why is it not B i cant understand
i will appreciate if someone can clarify for me
what is right
thanks