0% found this document useful (0 votes)
11 views1 page

Single Level Inheritance in Java

The document shows a program using single level inheritance in Java where class B inherits from class A, class B overrides methodA from class A, and the main method creates an instance of class B and calls both methodA and methodB.

Uploaded by

study.drizzle
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views1 page

Single Level Inheritance in Java

The document shows a program using single level inheritance in Java where class B inherits from class A, class B overrides methodA from class A, and the main method creates an instance of class B and calls both methodA and methodB.

Uploaded by

study.drizzle
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

//program on single level inheritance

public class A{
public void methodA()
{
[Link]("base class method");
}

}
class B extends A{
public void methodB(){
[Link]("child class method");
}
public static void main(String[] args)
{
B obj =new B();
[Link]();
[Link]();

}
}

You might also like