nus-cs2103-AY2021S1 / forum

20 stars 2 forks source link

Question about practice exam part 2 qn a #512

Closed EthanTheGoondu closed 3 years ago

EthanTheGoondu commented 3 years ago

For the question asking to draw the class diagrams, in the answers given to us they indicate that the methods are public when passed on the code they should be package protected:

The question: image

The answer: image

A ~ should be used, not + right? Is this a typo or is there an explanation for this? Any help is appreciated!

dextertanyj commented 3 years ago

In Java, all methods in an interface are implicitly public.

Java Documentation

damithc commented 3 years ago

In Java, all methods in an interface are implicitly public.

That's correct. In the exam, unlikely you will be penalized for not knowing that though.

EthanTheGoondu commented 3 years ago

In Java, all methods in an interface are implicitly public.

That's correct. In the exam, unlikely you will be penalized for not knowing that though.

Thanks!