Is the println method a method or a mutator in JAVA?

Q System.out.println, printlnis the accessor or mutator method in JAVA?

Thank....

+3
source share
3 answers

I would not say that. It exists only for side effects ; he is not obliged to do anything at all in the internal state System.out(this is what applies to accessories and mutators).

+7
source

This is not an accessor because it does not return a value (it void). It can be argued that this is a mutator, since it changes the state of the basic I / O system (has side effects), but this is not a clear difference, since it does not change the state of the class Systemor any of its instances.

, , (accessors), , (), println(), , ( ) .

+2

No. Accessories are getXXX, mutators are setXXX. println is not either.

0
source

All Articles