Posted In: Collections, Java Core

Randomly change order of elements in ArrayList

Shuffle array to change order To pick random object from ArrayList java.util.Collections shuffle code

Read More

by , on August 23rd, 2017

Posted In: IO, Java Core

How to create a file and write text to it

Techniques used 1. Before JDK 7 using BufferedWriter 2. Using JDK 7 Files 3. Apache Commons IOUtils 4. Guava library  

Read More

by , on August 23rd, 2017

Posted In: Date, Java Core

Calculate number of days between two Java date instances

Calculate difference between two Java date instances Techniques used 1. Using java.util.Date Before JDK 8 2. Using java.time.LocalDate JDK 8 3. Using JODA time org.joda.time.Days 4. Using JODA time org.joda.time.Interval

Read More

by , on August 23rd, 2017

  • Categories