0
Sponsored Links


Ad by Google
Well immutable is very popular in java, and of course one of the popular interview topic, In our previous post we have seen an example of How to create an immutable class. In interview sometimes interviewer also ask you to "Can you list down few immutable class in java api?" or What are the immutable classes you ever used from java classes, as we have already seen Why String is immutable now time to see some example of immutable classes in java api. And of course in this post we are going to list down few very popular immutable classes in java.

Example of immutable classes in java api

Below are the few very popular built in immutable classes.
  1. java.lang.String (Very popular:))
  2. java.lang.Double
  3. java.lang.Long
  4. java.lang.Float
  5. java.lang.Integer
  6. java.lang.Short
  7. java.lang.Byte
  8. java.lang.Boolean
  9. java.util.UUID
  10. java.lang.Character
  11. java.math.BigInteger
  12. java.util.Locale
  13. java.awt.Font
  14. java.net.URL

Friends, I have listed few popular immutable classes here, and if you used some other, than above list you can post that immutable class as in comment. I will add that to the list, So that, it will help someone.
Few very popular java interview questions:
Which Collection is better to store 10 millions of record between ArrayList and LinkedList?
Create your own ArrayList or Design your own ArrayList?
How many ways to iterate HashMap in java
What are the key differences between Comparable and Comparator.
Serializable vs Externalizable
Can you list down the methods of java.lang.Object class
How many ways to create Object in java
Java Program to find all missing numbers from an Array
What is the different between ArrayList and LinkedList?
Why hash code method in java?
Sponsored Links

0 comments:

Post a Comment