JAVA Exam Preparation Online Test

// Using super to overcome name hiding. class A { int i; } // Create a subclass by extending class A. class B extends A { int i; // this i hides the i in A B(int a, int b) { super.i = a; // i in A i = b; // i in B } void show() { System.out.println("i in superclass: " + super.i); System.out.println("i in subclass: " + i); } } class UseSuper { public static void main(String args[]) { B subOb = new B(1, 2);; } } what is the ouput of the above program ?THE
i in superclass: 1 i in subclass: 2
i in superclass: 2 i in subclass: 1
i in superclass: 3 i in subclass: 4
None of the above
Users’ browser settings will override the settings you make in your style sheets by default. It is easy for users to change the fonts, background colors, and size of the text. Users can also choose to turn off functionality such as Java, JavaScript, and image display.
LANAGE // Demonstrating some String methods. class StringDemo2 { public static void main(String args[]) { String strOb1 = "First String"; String strOb2 = "Second String"; String strOb3 = strOb1; System.out.println("Length of strOb1: " + strOb1.length()); System.out.println("Char at index 3 in strOb1: " + strOb1.charAt(3)); if(strOb1.equals(strOb2)) System.out.println("strOb1 == strOb2"); else System.out.println("strOb1 != strOb2"); if(strOb1.equals(strOb3)) System.out.println("strOb1 == strOb3"); else System.out.println("strOb1 != strOb3"); } } What is the output of the above program?
Length of strOb1: 11 Char at index 3 in strOb1: s strOb1 != strOb2 strOb1 == strOb3
Length of strOb1: 12 Char at index 3 in strOb1: s strOb1 != strOb2 strOb1 == strOb3
Length of strOb1: 13 Char at index 3 in strOb1: s strOb1 != strOb2 strOb1 == strOb3
None of the above
Demonstrate String arrays. class StringDemo3 { public static void main(String args[]) { String str[] = { "one", "two", "three" }; for(int i=0; i str[0]: one str[1]: two str[2]: three
str[1]: one str[2]: two str[3]: three
str[0]: two str[1]: three str[2]: four
None of the above
// Here, Box is extended to include color. class ColorBox extends Box { int color; // color of box ColorBox(double w, double h, double d, int c) { width = w; height = h; depth = d; color = c; } } In the above program which oops property is used?
None of the above

Get Ready For Java Exam With This JAVA Exam Preparation



For real, every idiot can send questions? wtf? 4-th question you can see from the plain that is wrong......for a rookie can be a bad start ...

1487 days 22 hours 1 minutes ago


I'm really disappointed!!
Get rid of this test as soon as possible!!

2248 days 4 hours 52 minutes ago


The 4th and 5th question are incorrect. Question 4 should be the first answer, since arrays always start at array[0]. the 5th question is incorrect because you are not overloading any method parameters in the class, you are only creating color. Inheritance should be the answer since "extends" is used, the KEYWORD for inheritance.

2364 days 4 hours 45 minutes ago


this is not a test, this is bullsh*t

3157 days 11 hours 10 minutes ago


4th question answer is wrong.. Try to change it... otherwise close the website..

3227 days 8 hours 27 minutes ago


4th question answer is wrong..

3354 days 12 hours 59 minutes ago

kc lim

Please modify the question no.4 answer. Is something wrong there.

Q5, i not really understand, because i choose Inheritance.
please, anyone can explain to me?

3411 days 10 hours 58 minutes ago


4th question answer is wrong i think

3528 days 1 hours 26 minutes ago


PLZ describe 4th ans ....

3549 days 6 hours 29 minutes ago


its a wrong ans where four comes

3556 days 6 hours 52 minutes ago

Sumit Jain
Java Teacher.
Test: 1

Your Facebook Friends on WizIQ