Hi anyone pls. explain why the below code prints z?
class StaticVars {
static char c = 'a';
}
public class SuperStatic extends StaticVars {
public static void main(
String [] args) {
StaticVars sv = new StaticVars();
SuperStatic sc = new SuperStatic();
sc.c = 'z';
System.out.println("value of c in StaticVars: " + sv.c);
System.out.println("value of c in SuperStatic: " + sc.c);
}
}
Thx.,