This file contains hidden or 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
// Traditional Simple Way: | |
public class Singleton { | |
private static final Singleton instance = new Singleton(); | |
private Singleton() { | |
} | |
public static Singleton getInstance() { | |
return instance; | |
} | |
} |
This file contains hidden or 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 pack; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
public class TriangleNumbersPuzzle | |
{ | |
private static int returnNumberOfDivisors(int inNum) |
NewerOlder