File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to create immutable classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to create immutable classes" Watch "How to create immutable classes" New topic
Author

How to create immutable classes

manish basotia
Ranch Hand

Joined: Jan 12, 2004
Posts: 47
Please reply fast
Erik Pragt
Ranch Hand

Joined: Sep 08, 2001
Posts: 125

Very easy
Scotty Sinclair
Greenhorn

Joined: Jun 26, 2003
Posts: 17
Hi,
Just to clarify, A class is immutable a long as no method calls will change the state of the class. So the above example is fine.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Check the javaRanch Journal: Mutable and Immutable Objects
Dave.
John O'Hanley
Greenhorn

Joined: Oct 13, 2002
Posts: 24
Here is some good info on immutable object:
http://www.javapractices.com/Topic29.cjp
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create immutable classes