Articles, dummyCategory

Java Convert Properties File to XML File – HowToDoInJava

Java example to create XML file from Properties object or any existing .properties file. Create XML File from Properties File To convert properties file into XML file, best way is to use java.util.Properties class. Process is : Load properties file into java.util.java.util.Properties class object. Use Properties.storeToXML() method to write the content as XML. Input Properties …

Articles, dummyCategory

Java Sort on Multiple Fields – Comparator.thenComparing() – HowToDoInJava

Java example to sort list of objects by multiple fields using Comparator.thenComparing() method. This method returns a lexicographic-order comparator with another comparator. It gives the same effect as SQL group by clause. Quick Reference: Group by multiple fields – Example Example of using thenComparing() to create Comparator which is capable of sorting by multiple fields. …