A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA Java SE 8 Programmer I Study Guide 1Z0-808
this week in the
Java in General
Joined: Mar 26, 2007
Mar 26, 2007 07:15:00
How to make a class immutable???
Jesper de Jong
Joined: Aug 16, 2005
Mar 26, 2007 07:17:00
Welcome to JavaRanch.
Do you know exactly what "immutable" means?
To make a class immutable, make sure that it does not have any non-private methods that change the internal state of instances of the clas (i.e. methods that change the values of member variables).
use a meaningful subject line
instead of "Java" when you ask a question.
[ March 26, 2007: Message edited by: Jesper Young ]
Java Beginners FAQ
JavaRanch SCJP FAQ
The Java Tutorial
Java SE 8 API documentation
I agree. Here's the link:
How to make a class immutable??????????
Making Immutable class
How do we implement immutability?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015