Open fwenyin opened 3 years ago
Yes, all attributes are required to be set as private final. Besides, I think we are prohibited to use instanceof to test the type of an object outside its own class.
Yes, ideally you should abide by the principles which we have learnt so you should use private final to ensure that the objects are immutable
From what I know, CodeCrunch will check for certain principles like immutability (not declaring attributes as private final will get flagged off when you submit) and also for example if you use instanceof to check the events will also lead to an instant F. So do take note of that!
Yes, we should always abide by the OOP principles taught to us when designing our code, hence all attributes must be private final to adhere to immutability and encapsulation. The design of the code should also adhere to the tell-don't-ask principle
Yeah, codecrunch will check if your attributes are declared private final. Requirements other than the tell-don't-ask are abstraction and encapsulation principles. You could also incorporate the use of Optionals to deal with null values if there are cases that results in null values
Ensure that all variables are final, and that you do not use instanceof. Also, check for potential cyclic dependencies as you do the project.
Hi yes that is one of the requirements for the project! attributes must be private final to make each class immutable. not sure if you solved it yet, but you can implement getter methods to access them from other classes. all the best!
Does everything have to be private final for the project, and are there other requirements/are we graded on principles like tell-dont-ask or is it just the graded on the accuracy of code tested on test cases (like lab)?