a) Encapsulation and Information hiding are used interchangeably. Yes, yes they are. And people use JDK and JRE interchangeably. But the JDK and the JRE are two different things. But people use those terms interchangeably. It doesn't mean they are the same thing. I think this is a very poor statement.
b) Encapsulation is a language feature. A language feature? Not sure exactly what a language feature is? Are keywords language features? Is it a language feature if a programmer doesn't have to do anything, ie, the system does it automatically?
If I declare a variable, it is not automatically encapsulated. The Java language does not do anything to automatically encapsulate the data. I don't know what a "language feature" is, and I don't think you'll ever hear this term being used on the
SCJA exam.
c) Information hiding is a design principle. A design principle?
prin�ci�ple - a fundamental doctrine or tenet; a distinctive ruling opinion
- dictionary.com
Well,
you should make your data private and accessible through public setters and getters. I guess that is a commonly accepted
philosophy, so I think this is correct.
d) Java can have encapsulated data that is not hidden. If a variable is private, but accessible through public setters and getters, it is philosophically encapsulated, but it is not actually hidden, so this is true.
e) All of the above I always think "All of the Above" options are bogus.
That's my take. I think it has the air of someone stretching to make an exam question, and as such, the wording is poor and misguiding.
-Cameron McKenzie