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); subOb.show(); } } 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.
False
True
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?
Polymarphisam
Inheritance
overloading
None of the above
Description:

Get Ready For Java Exam With This JAVA Exam Preparation

Discussion

George

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 ...

1261 days 8 hours 19 minutes ago

Adrian

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

2021 days 15 hours 9 minutes ago

Andrew

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.

2137 days 15 hours 3 minutes ago

Anton

this is not a test, this is bullsh*t

2930 days 21 hours 28 minutes ago

muthukumar

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

3000 days 18 hours 45 minutes ago

Govendran

4th question answer is wrong..

3127 days 23 hours 17 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?

3184 days 21 hours 16 minutes ago

chandubabu

4th question answer is wrong i think

3301 days 11 hours 44 minutes ago

muku

PLZ describe 4th ans ....

3322 days 16 hours 47 minutes ago

thulasunya

its a wrong ans where four comes

3329 days 17 hours 10 minutes ago

Sumit Jain
Java Teacher.
4 Followers
Test: 1

Your Facebook Friends on WizIQ