JAVA question class Test4A { protected int x; public Test4A() { x = 100;} public Test4A(int x) { this.x = x;} } public class Test4B extends Test4A { int x; public Test4B() {x = 200;} public Test4B(int...


JAVA question


class Test4A {


protected int x;


public Test4A() { x = 100;}


public Test4A(int x) { this.x = x;}


}


public class Test4B extends Test4A {


int x;


public Test4B() {x = 200;}


public Test4B(int x, int y) {


super(x);


this.x = y;


}


public static void main(String[] args) {


Test4A a = new Test4A();


Test4B b = new Test4B(10, 20);


System.out.println(a.x);


System.out.println(b.x);


Test4A c = b;


System.out.println(c.x);


}


}


Can you tell me the output and what happens when TEST4A c = b



May 17, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here