Java training test

public class A{ final public int getResult(int a, int b) { return 0; } } public class B extends A { public int getResult(int a, int b) { return 1; } } public class Test { public static void main(String args[]){ B b = new B(); System.out.println("x = " + b.getResult(0, 1)); } } a. x = 0 b. x = 1 c. Error de compilación. d. Ocurre una excepción en tiempo de ejecución.

public class A{ final public int getResult(int a, int b) { return 2; } } public class B extends A { public int getResult(int a, int b) { return 1; } } public class Test { public static void main(String args[]){ B b = new B(); System.out.println("x = " + b.getResult(0, 1)); } } a. x = 0 b. x = 1 c. Error de compilación. d. Ocurre una excepción en tiempo de ejecución.

Created by: 223344
  1. public class A{ final public int getResult(int a, int b) { return 0; } } public class B extends A { public int getResult(int a, int b) { return 1; } } public class Test { public static void main(String args[]){ B b = new B(); System.out.println("x = " + b.getResult(0, 1)); } }
  2. fasdf
  3. fadsfas
  4. fasdfasfdas
  5. afasfas
  6. fasdfasdfasdfasf
  7. 3
  8. a
  9. afsadfas
  10. fasdfasdf

Remember to rate this quiz on the next page!
Rating helps us to know which quizzes are good and which are bad.

What is GotoQuiz? A better kind of quiz site: no pop-ups, no registration requirements, just high-quality quizzes that you can create and share on your social network. Have a look around and see what we're about.