I was wondering what it means to say a field is hidden between 2 java classes and what it means when running code in terms of resulting output?
I have an abstract class with a protected static boolean field = false
and a sub class
which has a boolean field with the same name but is not static and set to true
.
If I had this code:
Superclass d = new subclass();
what would be the value of the boolean field in the superclass and the boolean field
in the subclass? Does subclass field stay as false
after the assignment above?