java question class test4a protected int x public test4a x 100 public test4a int x t 5152272

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

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now