Write a java program to implement single level inheritance. | VCMIT

by - March 13, 2020

Single Level Inheritance. 


INPUT

class Single{
 static int num1=10;
 static int num2=5;
}

class Main extends Single{
 public static void main(String[] args){
 int num3=2;
 int result=num1+num2+num3;
 System.out.println("Result of child class is "+result);
 }
}

OUTPUT



You May Also Like

0 Comments