OOPs

Ques: 37 
Given:
1. class TestA {
2.    public void start() { System.out.println("TestA"); }
3. }
 
4. public class TestB extends TestA {
5.    public void start() { System.out.println("TestB"); }
6.   public static void main(String[] args) {
7.     ((TestA)new TestB()).start();
8.   }
9. }

What is the result?
A. TestA
B. TestB
C. Compilation fails.
D. An exception is thrown at runtime.
Answer: B

4 comments:

  1. Candidates who find exam really challenging and not confidant about their success, dumps are good substitute for them as they ensure your success as most of the questions are from them. If anybody interested in SCJP6 dumps..mail me at mp7504@gmail.com.

    ReplyDelete
  2. yes dumps is the best way to pass exam

    ReplyDelete
  3. why that casting failed?

    ReplyDelete
  4. please send me the damp at nityananda777@gmail.com

    ReplyDelete