Created
January 23, 2022 21:40
-
-
Save httpmurilo/9dded421ca7f9f5262a5cb6f1bb9583e to your computer and use it in GitHub Desktop.
Singleton static factory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.murilo.school.model; | |
public class Student { | |
private static final Student INSTANCE = new Student(); | |
private Student() { | |
... | |
public static Student getInstance(); | |
} | |
private Integer id; | |
private String name; | |
private Integer age; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment