RosettaCodeData/Task/Singleton/Java/singleton-3.java

16 lines
278 B
Java
Raw Permalink Normal View History

2023-09-16 17:28:03 -07:00
public enum Singleton {
INSTANCE;
2023-07-01 11:58:00 -04:00
2023-09-16 17:28:03 -07:00
// Fields, constructors and methods...
private int value;
Singleton() {
value = 0;
2023-07-01 11:58:00 -04:00
}
2023-09-16 17:28:03 -07:00
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
2023-07-01 11:58:00 -04:00
}
}