simplified the println
This commit is contained in:
parent
13abf49024
commit
406d2e7081
@ -24,7 +24,7 @@ public class App {
|
||||
|
||||
EnumIvoryTower enumIvoryTower1 = EnumIvoryTower.getInstance();
|
||||
EnumIvoryTower enumIvoryTower2 = EnumIvoryTower.getInstance();
|
||||
System.out.println("enumIvoryTower1=" + enumIvoryTower1.getDeclaringClass().getCanonicalName() + "@" + enumIvoryTower1.hashCode());
|
||||
System.out.println("enumIvoryTower2=" + enumIvoryTower2.getDeclaringClass().getCanonicalName() + "@" + enumIvoryTower2.hashCode());
|
||||
System.out.println("enumIvoryTower1=" + enumIvoryTower1);
|
||||
System.out.println("enumIvoryTower2=" + enumIvoryTower2);
|
||||
}
|
||||
}
|
||||
|
@ -11,4 +11,9 @@ public enum EnumIvoryTower {
|
||||
public static EnumIvoryTower getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getDeclaringClass().getCanonicalName() + "@" + hashCode();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user