I'm trying to understand the idea of protected and package acesses and I've tried them on the compiler but it kept telling me that there's a problem
public class example{
int s = example2.v;
public static void main(String args[]){
}
}
public class example2 {
int v = 0 ;
}
Can anyone help me with this? why it says:
non-static variable v cannot be referenced from a static context.
Variable 's' is not static!