(45)
Answer (Choose 1 answer)
A. 3
B. Compilation error in line (2)
C. Compilation error in line (1)
D. Compilation error in line (3)
}
What will be the output of following code?
interface Eating{
public void getHour();public int getMeals();}
abstract class Meal implements Eating{ // (1)
public void getHour(){
System.out.println(getMeals());
}
} public class Main1 {
public static void main(String[] args) { (2)
e=new @Override
public int getMeals() {
return 3;
}
};
e.getHour();// (3)