nus-cs2113-AY2324S1 / forum

0 stars 0 forks source link

Accessibility vs Visibility #36

Closed skylee03 closed 1 year ago

skylee03 commented 1 year ago

In Week 8 Quiz, the first question is:

In the following class diagram, the ‘+’ and ‘-’ signs to indicate accessibility of the attributes and the methods. image

And the standard answer is:

False. It’s called visibility, not accessibility.

I'm wondering if there are any differences between the two terms. As far as I know, they are often used interchangeably, and The Java® Language Specification uses the term "accessibility".

okkhoy commented 1 year ago

As per the text: image

Some people do use it interchangeably; from UML perspective, visibility is more appropriate.

skylee03 commented 1 year ago

I see.

As per the text: image

Some people do use it interchangeably; from UML perspective, visibility is more appropriate.

So "accessibility" and "visibility" refer to the same thing, except that the former is a Java term and the latter is a UML term?