aspose file tools*
The moose likes Java in General and the fly likes Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java" Watch "Java" New topic
Author

Java

Suhail Mohammed
Greenhorn

Joined: Mar 26, 2007
Posts: 4
How to make a class immutable???
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13884
    
  10

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).

Also please 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 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java