What design pattern or principle is used in this class?.
public class Main { int height; public Main(int height) { this.height = height; } public int getHeight() { return height; } }
E.
Option C is clearly incorrect because the class has a public constructor so cannot be a singleton.
Options A, B, and D are also incorrect because the height instance variable is not private.
This means other classes in the same package can read and change the value.
Therefore, Option E is correct.