Hello,
You need to change your class A, because you have two problems:
1st - you don't have method at class A. you need to put your code inside one method
2nd - you can't access a instance variable like a class variable (static)
this code should work:
public class A{
protected int x;
-> public void test(){
C obj1 = new C ();
-> obj1.x = x;
}
I hope that helps you.