Rec 01
Question (without answers):
Answer:
Problems
01. Information Hiding and Tell, Don't Ask
This is a typical question about infromation hiding and "Tell, Don't Ask". Nothing much to talk about.
02. Stack and Heap
The thing we should learn from this question is how to declare and initialize an array in Java
// Declaration
private double[] coord2D;
// Initialization
coord2D = new double[] {1,2};03. Method Invocation
We cannot change the CTT of a variable. So, if we have declared
Circle c, we cannot useString canymore in the same segement.Always pay attention to whether the
Object::equals(Object)has been overriden or not. If not, it will always compare whether two instances are the same or not.
Tips
We cannot change the CTT of a variable. So, if we have declared
Circle c, we cannot useString canymore in the same segement.Always pay attention to whether the
Object::equals(Object)has been overriden or not. If not, it will always compare whether two instances are the same or not.
Last updated