Select chapter



basics (7.papers)
constructors (1.papers)
packages (1.papers)
inheritance (7.papers)
misc (3.papers)
exceptions (5.papers)
threads (4.papers)
overloading (1.papers)
jsp (3.papers)
servlets (9.papers)
jdbc (2.papers)
util (1.papers)
xml (2.papers)
IO stream (3.papers)
Hide

Sponsored Links


  

java interview questions and answers

Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
5
Select the valid option:

public abstract class Test implements I1, I2{
 public void m1(){}
 public void m2(){}
}
interface I1{
 int X = 1;
 int Y = 2;
 void m1();
 void m2();
}
interface I2{
 int Y = 3;
 int Z = 4;
 void m2();
 void m3();
}
  1. The code compiles succesfully
  2. Compilation fails as Test does not implement void m3()
  3. Compilation fails as void m2() is defined in both interfaces
  4. Compilation fails as int Y conflicts in two interfaces
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Read more papers :