Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 182
  • package inheritance; public class TestInheritance2 { pu...

package inheritance; public class TestInheritance2 { public int empId =100; public String name ="tcs" ; } package inheritance1; import inheritance.TestInheritance2; public class TestInheritance_2 extends TestInheritance2 { void printEmpId() { System.out.println("EmpId is "+empId); } public static void main(String[] args) { TestInheritance_2 T_2 = new TestInheritance_2(); T_2.printEmpId(); } }

technology programming languages
  1. Compiler Error

  2. EmpId is 0

  3. EmpId is 100

  4. Exception


Show answer
Correct Option: C

Find more quizzes:

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