Immutable
- 22 December
Immutable class interview questions
In this post, I am going to share java interview questions which are generally asked on immutable class. Immutable class is important topic as it deals with creation of thread safe class. Here I am providing some important immutable class interview questions with answers. 1. What is immutable class? Answer : Immutable objects are those […]
- 21 December
How to create immutable class in java
In this tutorial, we are going to see how to create immutable class in java. Immutable class is class whose state can not be changed once created. Example: String is best example for immutable class. Once you create a String, you can not change it. Immutable class is very simple to understand, it has only […]
- 07 May
Why String is immutable in java
String class is immutable in java. If you take dictionary meaning of immutable, it means unable to be changed or unchanging over time, so String is unchangeable or unmodifiable in java. Let’s understand with example. [crayon-6741b4f0e00fc692990037/] As you can see, value of str1 did not change. It created another String object with value “Hellojava2blog” but […]