Design an Immutable class in Java

  1. They are thread-safe as the state of the object can’t be changed.
  2. They are good candidates for keys in the HashMap

--

--

--

Senior Software Engineer @ Airtel X Labs

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Introducing FeatureHub — Open Source Feature Flag Management and Experimentation platform

A RIOT-OS application sending data via MQTT-SN/MQTT to ThingsBoard

Tracking Developer Productivity Isn’t Productive. How Do We Fix It?

Major League Tutorials: UI Testing in iOS

Introducing Pubby — our custom WebSockets solution

Newly-Introduced JUnit 5 Annotations and Classes. @DisplayName annotation

Rewind Dev Log #3

How to automate the deployment of your Elixir project with CircleCI

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mayank Jain

Mayank Jain

Senior Software Engineer @ Airtel X Labs

More from Medium

Marker Interfaces in Java

Learn SOLID Design Principles in Java by Coding It

Design Pattern in Java — Visitor pattern

Use This Design Pattern to Cache Selective Data in Java