Hey all. I would like to find out how i can access/ get the value of a variable in a different class. this is part of the code which shows what I was trying to do.
public class A{
protected int x;
//missing code
C obj = new C ();
C.x=x; //i get an error "indentifier expected"
}
class C extends B{
protected int x;
public int getInt()
{
System.out.print("Enter Value ");
x=scan.nextInt();
return x;
}
}