ittimepass.com
Write a program in java to demonstrate in inheritance? ⋆ IT TIME PASS
import java.util.Scanner; class P { int a,b; public void add(int x,int y) { a=x; b=y; System.out.println("Addition "+(a+b)); } } class C extends P { public void sub(int x,int y) { a=x; b=y; System.out.println("Subtraction "+(a-b)); } public static void main(String arg[]) …