Skip to main content

Java Object to/from JSON – Jackson 2

1.) Overview In this tutorial, we discuss how to serialize Java Object into JSON and deserialize JSON String into Java Object using Jackson 2. 2) Dependencies Add these dependencies to pom.xml.

3) Serialize and Deserialize using ObjectMapper We are using User.java class to serialize and deserialize throughout this tutorial.

3) JSON to Java […]

Read More

ArrayList Sorting :- Part 1 – using Comparable and Comparator

In this tutorial, we’ve shared few examples of sorting ArrayList. String ArrayList Collections.sort() and Collections.reverseOrder() can be used for sorting and reverse sorting.

Read More

Java 8 API: java.time.Instant

Epoch time is the number of seconds since January 1st, 1970. 1 minute – 60 seconds 1 hour – 3600 seconds 1 day – 86400 seconds Creating an Epoch Time The easiest way to create epoch time is, using Systerm.currentTimeMillis()

This time format is not human readable, but it’s suitable to store in a database, business […]

Read More

RSS
Follow by Email
Facebook
Facebook
Google+
http://mydevgeek.com/tag/java/page/2
Twitter