Java/Samples
-
[Samples] - PropertiesFileWriterJava/Samples 2016. 5. 24. 11:33
import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.Writer; import java.util.Map.Entry; import java.util.Properties; public class PropertiesFileWriter extends BufferedWriter { private static final String EXTENSION = "properties"; private static final String COMMENT_HEADER = "#"; private PropertiesFileWriter(Writer out) throws ..
-
[Samples] - StopWatchJava/Samples 2015. 12. 14. 13:34
class StopWatch { private long startTime; private long endTime; public void start() { startTime = System.currentTimeMillis(); } public void stop() { endTime = System.currentTimeMillis(); } public long getTime() { return endTime - startTime; } @Override public String toString() { long timems = getTime(); long time = timems ⁄ 1000; long hour = 0, minute = 0, second = 0; second = time % 60L; minute..