what will be the output ?<br /> <br /> class Animal { <br /> public void eat() throws Exception { <br /> }<br /> }<br /> <br /> class Dog2 extends Animal { <br /> public void eat(){} <br /> public static void main(){ <br /> Animal an = new Dog2(); <br /> an.eat(); <br /> }<br /> }
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. what will be the output ?

class Animal {
public void eat() throws Exception {
}
}

class Dog2 extends Animal {
public void eat(){}
public static void main(){
Animal an = new Dog2();
an.eat();
}
}
Core Java
Ans. Compile Time Error: Unhandled exception type Exception

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   code   coding   overridding   late binding   exception handling   abstract class   abstract methods


Related Questions

  Differences between abstract class and interface ?
  Difference between Abstract and Concrete Class ?
 If an Abstract class has only abstract methods, What's the difference between such a class and an interface ?
  What are the design considerations while making a choice between using interface and abstract class ?
  How is Abstraction implemented in Java ?
 Difference between Base Class, Derived Class , Abstract Class and Concrete Class ?
 What is an abstract class ?
  Shall we use abstract classes or Interfaces in Policy / Strategy Design Pattern ?
  Will this code Work ? If not , Why ?
  Is java.util.Date an abstract Class ? Is java.util.Calendar an abstract Class ?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: