Category: Collections

How can we write Java properties in a defined order 0

How can we write Java properties in a defined order

I’m using java.util.Properties’s store(Writer, String) method to store the properties. In the resulting text file, the properties are stored in a haphazard order. This is what I’m doing: Properties properties = createProperties(); properties.store(new FileWriter(file),...

The Internal Cache of Integers 0

The Internal Cache of Integers

Instances of Integer and other wrapper classes are cached by the JVM for increased performance. package collections;   public class IntegerCache { private static void test(Integer i, Integer i2) { System.out.println(i); if (i ==...