- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHackerrankJava0058.java
More file actions
Latest commit
24 lines (17 loc) · 665 Bytes
/
Copy pathHackerrankJava0058.java
File metadata and controls
24 lines (17 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
publicclassHackerrankJava0058 {
// Java Singleton Pattern
// https://www.hackerrank.com/challenges/java-singleton/problem?isFullScreen=true
// -------------------------------------------------------------------------------------------------
// You need to replace all HackerrankJava0058 as Singleton.
// -------------------------------------------------------------------------------------------------
publicStringstr;
privatestaticHackerrankJava0058instance;
privateHackerrankJava0058() {
}
publicstaticHackerrankJava0058getSingleInstance() {
if (instance == null) {
instance = newHackerrankJava0058();
}
returninstance;
}
}