Question
In what follows, you have multiple choice questions related to the provided java code. Put your answers in the below table. 1 2 3 4
In what follows, you have multiple choice questions related to the provided java code. Put your answers in the below table.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|
|
|
|
|
|
|
|
|
|
public interface One { public abstract void A(); } |
public abstract class Two implements One{ public void A(){ System.out.println("2A"); } public void B(){ System.out.println("2B"); } public abstract void C(); public void D(){ System.out.println("2D"); } } |
public class Three extends Two{ public void A(){ System.out.println("3A"); } public void C(){ System.out.println("3C"); } } |
public class Four { public void A(){ System.out.println("4A"); } } |
public class MCQ{ public static void main(String[] args){ // To Do code here taken from the next page
} } |
In each question you have lines of java code. You should assume that these lines of code are in the main method, and choose the correct output from the corresponding multiple choices.
1 | Two tst = new Three(); tst.D(); |
|
2 | Two tst = new Three(); tst.C(); |
|
3 | One tst = new One(); tst.A();
|
|
4 | Two tst = new Two(); tst.B(); |
|
5 | Object tst = new Four(); tst.A(); |
|
6 | Object o = new Four(); Three tst = (Three) o; tst.A(); |
|
7 | Three tst = new Two(); tst.C(); |
|
8 | Three tst = new Three(); tst.B(); |
|
9 | Two tst = new Three(); tst.A(); |
|
10 | One tst = new Three(); tst.A(); |
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started