Answers for "What is inheritance in java? Discuss types of inheritance used in java with suitable program."

2

Inheritance in java

// Multiple inheritance in java
interface M
{
   public void helloWorld();
}
interface N
{
   public void helloWorld();
}
// implementing interfaces
public class MultipleInheritanceExample implements M, N
{
   public void helloWorld()
   {
      System.out.println("helloWorld() method");
   }
   public static void main(String[] args) 
   {
      MultipleInheritanceExample obj = new MultipleInheritanceExample();
      obj.helloWorld();
   }
}
Posted by: Guest on November-23-2020

Code answers related to "What is inheritance in java? Discuss types of inheritance used in java with suitable program."

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language