user496949 user496949 - 1 month ago 12
Java Question

For a boolean field, what is the naming convention for its getter/setter?

Eg.

boolean isCurrent = false;


What do you name its getter and setter?

Answer

Suppose you have

boolean active;

Accessors method would be

public boolean isActive(){return this.active;}

public void setActive(boolean active){this.active = active;}

See Also