|
|
400 Mock Questions on OCPJP 6 (formerly known as SCJP 1.6)
JUST Rs.300 or 10 USD Send us mail to sales@javabeat.net
more details
|
|
Do you have paypal account? Click Here to pay now and get the questions.
|
|
SCJP 1.4 Mock Exam -1 Answers
1) A1 is correct
Local Array variables are initialized to their default values.
2) A3)double []arr = new double[10];
A1 is not valid because (new int[]) array size must be specified unless it is annonymous array declaration.
A2 is not valid because array declaration must not specify the size of the array.
3) A2) Compiler Error
non-static(instance) methods or variables are cannot be referenced from static context.Compiler will give the following error while compiling the above code:
Test3.java:6: non-static method method() cannot be referenced from a static context method();
4) A1) "Called"
Static methods canbe called only by referance.Because its not binded with objects.So, in this case "null" value doesn't make sense."method" is called without any problem.
5) A2)"Constructor2"
Constructors cannot have return types. If its declared with return types then it is consider as methods. So, output wull be "Constructor2".
6) A3)Compiler Error
7) A3)Hai Hi
8) A1)public Test8(){}
A3)protected Test8(int k){}
9) A3)final void method(){}
A4)int method(){}
10) A1) class Test10
A2) public Test10
A3) final Test10
11) b)variable
12) c)final static class()
d)public final strictfp class{}
13) b)public className()
c)private className()
14) c)public
d)final
e)abstract
15) b)int arr[][] = new int [10][10];
d)float arr[] = new float[10];
16) c)Static
17) d)Compiler Error
18) a)Main Method1
19) c)Runtime Exception
20) d)Compiler Error
21) A1)String
A4)String Buffer
22) A4)None of the Above
23) A3)float f = 1.2;
24)A1) false true
25)A4)Compiler error
|
|
400 Mock Questions on OCPJP 6 (formerly known as SCJP 1.6)
JUST Rs.300 or 10 USD Send us mail to sales@javabeat.net
more details
|
|