1.
What is java ?
A. 
B. 
C. 
D. 
E. 
Software devlopment language
2.
Which of these is a keyword in java?
A. 
B. 
C. 
D. 
E. 
3.
Which is legal identifier name?
A. 
B. 
C. 
D. 
E. 
4.
"Tiger" is used to denote which version of java?
A. 
B. 
C. 
D. 
E. 
5.
Which one of these is primitive datatype in java?
A. 
B. 
C. 
D. 
E. 
6.
Try{int x=Integer.parseInt("two");}what type of exceptions can be caugth in catch block?
A. 
B. 
C. 
D. 
IllegalMonitorStateException
E. 
ArrayIndexOutOfBoundException
7.
Class A{static void sing(){System.out.print("fa");}}class B extends A{static void sing(){System.out.print("la";)}public static void main(String[] args){A one=new B();B two=new B();System.out.print(one.sing()+""+two.sing());}}}what is the result?
A. 
B. 
C. 
D. 
E. 
8.
Class Top{Top(String s){System.out.println("Hello");}}class Bottom extends Top{Bottom(String t){}public static void main(String[] args){new Bottom("BIT"); }}what is the result?
A. 
B. 
C. 
An Exception is thrown at run time
D. 
E. 
9.
Class Alpha{int over=1;}class Beta extends Alpha{int over=2; }class Gamma extends Beta{int over=3;public static void main(String[] args){new Gamma().go();}void go(){Beta b=new Gamma();Alpha a=new Gamma();System.out.println(super.over+""+b.over+""+a.over);}}what is the result?
A. 
B. 
C. 
D. 
E. 
10.
Public class Switch2{public static short x=1;staticfinal int y=3;public static void main(String[] args){for(int z=3;z>0;--z){switch(z){case y:System.out.print("0");case y-1:System.out.print("1");case x:z--;}}}}what is the result?
A. 
B. 
C. 
Compilation fails at line 7
D. 
Compilation fails at line 8
E. 
Compilation fails at line 9
11.
Class Zeta{public static void main(String[] args){int x=1;if((4>x)^((++x + 2)>3)) x++;if((4 > ++x)^(++x==5)) x++;System.out.print(x);}}what is the result?
A. 
B. 
C. 
D. 
E. 
12.
Which are true?
A. 
A static method cannot be synchronized.
B. 
If a class has synchronized code,multiple threads can still access the non-synchronized code.
C. 
Variables can be marked synchronized
D. 
When a thread sleeps,it releases its locks
E. 
When a thread invockes wait(),it releases its locks
13.
Public class MyProgram{public static void main(String[] args){try{ System.out.print("Hello World");}finally{System.out.println("Finally executing");}}}what is the result?
A. 
B. 
C. 
D. 
Hello world Finally executing
E. 
Finally executing Hello world
14.
Class Alpha{int doStuff(float b){return 7;}}class Beta extends Alha{//insert code here}which,inserted independently at line 8,will compile?
A. 
Private int doStuff(float y){return 4;}
B. 
Protected int doStuff(float y){return 4;}
C. 
Public Integer doStuff(float y){return 4;}
D. 
Final int doStuff(float y){return 4;}
E. 
Public long doStuff(float y){return 4;}
15.
Class Silky extends Smooth{int x=5;int y=7;public static void main(String[] args){new Silky().go();}void go(){if(x>y & (Boolean)(this instanceof Silky)) System.out.print("a");if(Long.valueOf(4) instanceof Number) System.out.print("b");}}class Smooth{}what is the result?
A. 
B. 
C. 
D. 
E. 
An exception is thrown at runtime
16.
Which are true?
A. 
Encapsulation limits the consequences of change.
B. 
Encapsulation makes it easier to reuse classes.
C. 
Encapsulation results in better testing and higher reliability.
D. 
Encapsulation means that methods are all public.
E. 
Encapsulation means that classes are members of packages.
17.
Class X{void go(){System.out.print("x");}}class Y extends X{void go(){System.out.print("y");}}class Z extends X{void go(){System.out.print("z");}}class Chrome1{public static void main(String[] args){X z=new Z();X y=new Y();Z y2=(Z)y;y.go();y2.go();}}what is the result?
A. 
B. 
C. 
D. 
E. 
An exception is thrown at runtime
18.
Public class Felix{ protected long cat(){return 7L;}}class Oscar extends Felix{//insert code here}
which method inserted ,will compile?
A. 
Private long cat(int x){return 7;}
B. 
Public long cat(){return 7;}
C. 
D. 
Protected int cat(int x){return 7;}
E. 
19.
Which of the following are legal definitions for non-nested classes and interfaces?
A. 
Static public interface Foo{}
B. 
Abstract public class Foo{}
C. 
Protected interface Foo{}
D. 
Final abstract class Foo{}
E. 
20.
Public class Switch2{public static void main(String[] args){int y=0;for(int x=3;x>=0;x--){switch(x){case 3:y=y+100;case 2:y=y+10;case 1:break;case 0:y=y+1;}}System.out.println(y);}}what is the result?
A. 
B. 
C. 
D. 
E. 
21.
Public static void main(String[] args){TreeSet<Number> tree=new TreeSet<Number>();tree.add(108);//insert here}which is inserted to compile and run
A. 
B. 
C. 
Tree.add(Integer.valueOf("-1"));
D. 
E. 
22.
Calss Bulbs{ enum Turn{ ON("bright"),OFF("dark");}public staticmvoid main(String[] args){ System.out.println(Turn.ON);}}what is the result?
A. 
B. 
C. 
D. 
E. 
23.
Which is true?
A. 
It is not good practice to place assertions where you think execution should never reach.
B. 
It is sometimes appropriate to call getters and setters from assertions.
C. 
Use assertions to verify the arguments of private methods.
D. 
Assertions can be disabled for a particular class
E. 
Never throw an AssertionError explicitly
24.
Class Battery{static int x=1;public static void main(String[] args) throws Throwable{try{if(x==1)throw new Throwable();System.out.println("try");}catch(Exception e){System.out.println("exc");}finally{System.out.println("fin");}}}what is the result?
A. 
B. 
C. 
D. 
Fin then a runtime exception
E. 
25.
Which of the following can be constructed using a String?
A. 
B. 
C. 
D. 
E.