NEW
Font size
WorksheetsQuiz for Module2
Total questions: 10
Worksheet time: 17mins
Predict the output:
1,3
3,1
1,1
1,0
Predict the output:
20
10
Error in Object creation
None of the above
Predict the output:
10
20
10
Compile Time Error
20
Predict the output:
A
B
Compile Time Error
No output
Predict the output:
A
B
Compile Time Error in line 10 : Cannot override.
No output
Predict the output:
Option 1 : Both are Same
Option 2 : Both are Same
Option 3 : Both are Same
Option 2 : Both are Same
Option 3 : Both are Same
Option 2 : Both are Same
Option 1 : Both are Same
Predict the output:
CompileTime Error @ Line 1
allwelcome
prints nothing
hiallwelcome
Which one of the below ways is correct to create a String from char
char ch = 'a';
String str = new String(ch);
char cha[] = {'a'};
String str = new String(cha);
char ch='a';
String str = ch;
char cha[] = {'a'};
String str = cha;
Which of the following statements are true? Select all that apply.
A. We cannot override a static method in Java.
B. We can overload a static method in Java.
C. We cannot override a private method in Java.
A and B
B and C
A, B and C
None of the above
Debug the given code:
char ch = 'c'; //line1
int num = 88; //line2
ch = num; //line3
System.out.println(ch); //line4
X
8
Error at line3: Lossy conversion from int to char
None of the above
