Multil inheritance
Mon Nov 25 2024 08:51:27 GMT+0000 (Coordinated Universal Time)
Saved by
@javalab
import java.util.*;
class Ae {
int x;
void getAe() {
System.out.println("Enter the value of x"); Scanner sc = new Scanner(System.in); x = sc.nextInt(); }
class B extends Ae {
int y:
void getB() {
System.out.println("Enter the value of y"); Scanner sc = new Scanner(System.in); y = sc.nextInt(); }
}
class C extends B {
void result() {
System.out.println("Result:=" .println("Result:=\t" + (x + y)); }
public class W2_iii_MultiLevellnheritance {
public static void main(String[] args) {
C c1 = new C();
c1.getAe();
c1.getB();
c1.result();
content_copyCOPY
Comments