About Question enthuware.ocajp.i.v8.2.890 :
Posted: Wed Oct 25, 2017 2:59 am
I think thear are two correct answers:
*) mysq = new Square(20);
*) mysq.setSide(20);
Because after mysq = new Square(20) mysq refered to Square object and it side == 20. Despite the fact that this is a new object, this does not contradict the wording of the question!
*) mysq = new Square(20);
*) mysq.setSide(20);
Because after mysq = new Square(20) mysq refered to Square object and it side == 20. Despite the fact that this is a new object, this does not contradict the wording of the question!