![]() |
About  | Contact  | Site Map  |  Mirror    |
Voodoo Exam  |  Question Bank  |  Databases  |  Tutorials    |
|
    |
Question Bank 2 We have moved to a new website(www.irixtech.com) where you can now take mock exams online, come back & review your answers later, ask questions in our forums & SCJP questions ranging from SCJP 1.4 to SCJP 6.0, including these question banks & dumps from this site. Click here to take this question bank as an interactive mock exam Comments & suggestions will be highly appreciated . If you'd like to see your question's here mail me . 1. What is the output when Test01 class is run ? class A{ A(){ //some initialization } void do_something(){ System.out.println("I'm in A"); } }; class B extends A{ B(){ //some initialization } void do_something(){ System.out.println("I'm in B"); } }; class Test01{ public static void main(String args[]){ A a = new B(); a.do_something(); } }; Options :
2. What is the output for the following code ? class Q014{ public String get(int i){ return null; } public static void main(String ka[]){ System.out.println((new Q014()).get(1)); } }; Options :
3.What is the output ? class Q018{ static Object obj; static String get(){ return null; } public static void main(String args[]){ System.out.println((Q018.get()) == (Q018.obj)); } }; Options :
4. What is the output ? class Q015{ public String get(int i){ return null; } public static void main(String ka[]){ Q015 obj = new Q015(); Object i = obj.get(10); System.out.println(i.toString()); } }; Options :
5.What is the output ? class Q013{ int i; Q013(int i){ System.out.println(i); } public static void main(String ka[]){ Q013 obj = new Q013(10); System.out.println(obj.i); } } Options :
6. What is the output ? class Test02{ public String fetch(){ return null; } public static void main(String args[]){ Test02 obj = new Test02(); String str = obj.fetch(); System.out.println((str+"").toString()); } }; Options :
7. What is the output ? class Q022{ public static void main(String ka[]){ while(false){ System.out.println("Great"); } } }; Options :
8. What is the output ? class A{ static int i; private int get(){ return 1; } }; class B extends A{ private int get(){ return 2; } }; class Q027 extends B{ public static void main(String ka[]){ Q027 obj = new Q027(); System.out.println(obj.get()); } }; Options :
9. What is the output ? class Q029{ public static void main(String args[]){ boolean b[] = new boolean[2]; System.out.println(b[1]); } }; Options :
10. Consider the following applet . Is there something wrong with it ? Choose the most appropriate option ( only one ) . public class App_Test extends Applet{ App_Test(){ //some initialization } public void paint(Graphics g){ g.drawString("Applet started" , 50 , 50); } }; Options :
Answers :
|
© 2000-2002 Ashish Hareet |