Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • web technology Online Quiz - 114
  • package polymorphism;class TestPolymorphismSuper { int p; Te...

package polymorphism;class TestPolymorphismSuper { int p; TestPolymorphismSuper testPoly() { TestPolymorphismSuper TS = new TestPolymorphismSuper(); TS.p =100; return TS; }}public class TestPolymorphism1 extends TestPolymorphismSuper{ TestPolymorphism1 testPoly() { TestPolymorphism1 TSub = new TestPolymorphism1(); TSub.p =500; return TSub; } public static void main(String[] args) { TestPolymorphismSuper TSuper = new TestPolymorphism1(); TSuper = TSuper.testPoly(); System.out.println(TSuper.p); }}

technology web technology
  1. 500

  2. 100

  3. 0

  4. Null Pointer Exception


Show answer
Correct Option: A

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy