class User {
private static final User INSTANCE;
private User() {}
public static User getInstance() {
synchronized(User.INSTANCE) {
if (User.INSTANCE == null) {
User.INSTANCE = new User();
}
}
return User.INSTANCE;
}
public String getName() {
// return user's name
}