Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 180
  • package polymorphism; class TestPolymorphismSuper1 { String...

package polymorphism; class TestPolymorphismSuper1 { String name; TestPolymorphism2 testPoly() { TestPolymorphism2 TS = new TestPolymorphism2(); TS.name ="tcs"; return TS; } } public class TestPolymorphism2 extends TestPolymorphismSuper1{ TestPolymorphism2 testPoly() { TestPolymorphism2 TSub = new TestPolymorphism2(); TSub.name = "UX"; return TSub; } public static void main(String[] args) { TestPolymorphismSuper1 TSuper = new TestPolymorphism2(); TSuper.testPoly(); System.out.println(TSuper.name); } }

technology programming languages
  1. tcs

  2. UX

  3. null

  4. Exception


Show answer
Correct Option: C

Find more quizzes:

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