google.com, pub-8786015629279405, DIRECT, f08c47fec0942fa0 Write a Program to implement Single Level Inheritance in Java

Write a Program to implement Single Level Inheritance in Java

0


// Write a Program to implement Single Level Inheritance in Java.


import java.io.*;

class A
{  
void displayA()
{
System.out.println("Class A...");
}  
}  

class B extends A
{  
void displayB()
{
System.out.println("Class B...");
}  
}  

class singleinheritance
{  
public static void main(String args[])
{  
B b=new B();
  
b.displayB();
  
b.displayA();  
}

Output:

Write a Program to implement Single Level Inheritance in Java


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Thank you for your interest 😊

We will back shortly after reviewing...

Thank you for your interest 😊

We will back shortly after reviewing...

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top