class A
{
void ADD()
{
System.out.println("enter your name ");
}
}
class B extends A
{
void SUB()
{
System.out.println("Enter your enrollemnet number");
}
}
class C extends A
{
void MULTI()
{
System.out.println("enter your college name ");
}
}
class D
{
public static void main(String[] args)
{
B r = new B();
C r2= new C();
r.ADD(); r.SUB();
r2.ADD(); r2.MULTI();
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter