Which best describes this code?
class Main { private int data; public int getData() { return data; } public void setData(int data) { this.data = data; } }
B.
This code is not a singleton because it has a public constructor.
A public no-argument constructor is provided automatically if no constructor is coded.
This code is well encapsulated because the instance variable is private.
It is not immutable since there is a setter method.
Option B is correct.