Limited access

Upgrade to access all content for this subject

When designing a class, which of the following would be the BEST reason for making a method private?

A

When you do not want other programmers to change the method’s code.

B

When the method needs to be called from another class.

C

When the method returns a value that is helpful in other classes.

D

When the method is only useful in the class it is defined in.

E

When the other methods in the class are defined as private.

Select an assignment template