What are the main differences between legacy Date/Time API in Java and Date/Time API of Java 8?

Main difference between legacy Date/Time API and Java 8 Date/Time API are:

  • Old API is not Thread safe. Java 8 API is Thread safe.
  • Old API has many mutable objects. New Java 8 API is based on Immutable objects.
  • Performance of old API is not good. New Java 8 Date/Time API gives better performance.
  • Old API is less readable and maintainable. New Java 8 API is very well designed and is more readable.
  • Old API has month values from 0 to 11. New API has months from 1 to 12.
Read the full book at www.amazon.com
Posted in Java 8, Java 8 Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*