Java Reference
In-Depth Information
Y (int a, int b, int c)
{
Super (a, b);
r = c;
}
Void show ( ) {
System.out.println (“r: “+ r );
}
}
Class override {
Public static void main (string args [])
{
y subob =new y (1, 2, 3);
Subob. Show ();
}
}
Output
r = 3
Types of inheritance
There are three types of inheritance.
Single inheritance
Multiple inheritance
Hierarchical inheritance
Search WWH ::




Custom Search