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 Immutable class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Storm Applied this week in the Other Open Source APIs forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Immutable class" Watch "Immutable class" New topic
Author

Immutable class

leela krishhna
Greenhorn

Joined: Aug 24, 2012
Posts: 10
How to create simple User defined Immutable class...
R. Jain
Ranch Hand

Joined: Aug 11, 2012
Posts: 375
    
    1

You need to post some code here, to show what efforts you have already made..
Whatever code you have implemented to get the outcome.. Or at least the idea you have.

You can get better inputs from other users.
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19471
    
  10

Here's a simple example:



Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19471
    
  10

By the way, I didn't post that example for a joke. It is indeed an immutable class, and it's the simplest possible example.

So now here's an exercise for you: Explain why it is immutable. (Hint: what does "immutable" mean? And does this class satisfy that definition?)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Immutable class