I noticed I can do:
public class Message {
public static final int MIN_BYTES = 5;
}
...and set this class as parent of another and set the same constant with another value like:
public class Ack extends Message {
public static final int MIN_BYTES = 1;
}
Since compiler does not complaing, this lead me to the questions above:
- Are these variables really the same?
- I would say it gets the most specific, so in that case from the Ack class. Is that true?
- Constants cannot have their value changed (it is final), so if the question 1 is true, how is that possible?
Thanks!