Question: i cant run following program.can any one fix the problem public class helloApp{ public static void main(String[]args){ B b1 = new C(3,one,Two); } } public
i cant run following program.can any one fix the problem
public class helloApp{ public static void main(String[]args){ B b1 = new C(3,"one","Two"); } }
public class B{ private String s; public void setB(String s){ this.s = s; } public String gets(){ return s; } }
public class C extends B{ private int x; private String a; private String s; public C(int x,String a,String s){ this.x = x; this.a = a; super (s); s = "Five"; System.out.println("C:x is " + x); System.out.println("C:a is " + a); System.out.println("B:s is " + s); //System.out.println("B:s is " + getS()); System.out.println("C:s is " + s); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
