Download this file
17 lines (16 with data), 487 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 | public class Cache {// Compile this class, create cache.jar and copy it to /usr/share/java
static Cache instance=null;
public static Cache getInstance() {
if(instance==null) instance=makeInstance();
return instance;
}
static Cache makeInstance() {
Cache cache=null;
try {
System.out.println("create new instance");
java.lang.Thread.sleep(3000);
System.out.println("done creating new instance");
} catch (Exception e) {}
return cache;
}
}
|
×
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.