Java Murged Final
Java Murged Final
Q4. which is the first line (if any) that causes a compilation error ?
public static void main(String args[])
{
char c;
int i;
c = 'A'; // 1
i = c; //2
c = i + 1; //3
c++; //
}
a) The line labeled 1.
b) The line labeled 2.
c) The line labeled 3.
d) The line labeled 4.
Q1 A
Q2 C
Q3 A
Q4 C
Q5 B
Q6 D
Q7 A
Q8 D
Q9 B
Q10 C
Q1 B
Q2 C
Q3 A
Q4 A
Q5 D
Q6 A
Q7 A
Q8 B
Q9 D
Q10 B
Q5. Which of the following declares an abstract method in an abstract Java class?
a) public abstract method();
b) public abstract void method();
c) public void method() {}
d) public void abstract Method();
Q1 C
Q2 A
Q3 C
Q4 C
Q5 B
Q6 B
Q7 C
Q8 C
Q9 C
Q10 A
Telegram- @Mockwarriors_itexam
Q8. What is the output of the following code:
class MockWarriors{
{
System.out.println("Finally Joined Our Community");
}
public static void main(String args[]) {
}
}
a) Finally Joined Our Community
b) no output
c) Run Time Error
d) Compilation Error
a) Only 2
b) Both 1 and 2
c) Both 1, 2 and 4
d) Only 3
Q1 B
Q2 C
Q3 A
Q4 A
Q5 B
Q6 D
Q7 B
Q8 B
Q9 A
Q10 C
Telegram- @Mockwarriors_itexam
www.MOCKWARRIORS.com