• Dear Guest, Please do NOT forget to join our JAVA JOBS (ONLY) FACEBOOK GROUP to be aware of latest JAVA openings, and you may also post any JAVA related queries/jobs.

How to create a Immutable class?

Re: Immutable

yes we can make a class a immutable

public class final ClassName
--- all properties must be final and private
private final int i =10;

--- all behaviours must be final
1. Announce the class Concerning illustration last thus it can't be stretched out.
2. Make know fields private thereabouts that regulate right is not permitted.
3. Don't give setter techniques to variables.
4. Aggravate all alterable fields last thereabouts that its esteem could make doled out main once.