class LabTask15
{
int a=10;
void friend()
{
System.out.println("my friends");
}
}
class Best extends LabTask15
{
int b=20;
void bestu()
{
System.out.println("My Bestie1 is Siva.");
System.out.println("My Bestie2 is Sai.");
}
public static void main(String[] args)
{
LabTask15 n1=new LabTask15();
System.out.println(n1.a);
Best n2=new Best();
System.out.println(n2.b);
n2.bestu();
}}
class A
{
int a=10;
void read()
{
System.out.println("This is read method");
}
}
class B extends A
{
int b=20;
void add()
{
System.out.println("This is addition");
}
}
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