Results 1 to 4 of 4
- 07-04-2011, 09:32 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 26
- Rep Power
- 0
- 07-04-2011, 09:47 AM #2
Hi. You can use "final" keyword for this aim. if you want to close access to inside variables you will not be able to make a set's modification in this class.
Skype: petrarsentev
http://TrackStudio.com
- 07-04-2011, 10:12 AM #3
Is Google down in your part of the world?
Immutable object - Wikipedia, the free encyclopedia
db
- 07-04-2011, 11:50 PM #4
Senior Member
- Join Date
- Mar 2009
- Posts
- 552
- Rep Power
- 5
In short, declare the class as 'public final class ImmutableThing', and all variables too. Can't modify anything then, and that's what makes something immutable. Besides that, google is your friend.
If the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!
Similar Threads
-
Problem with user defined class in ArrayList
By anders73 in forum New To JavaReplies: 4Last Post: 04-26-2011, 03:59 PM -
Write & Call User-Defined Method
By lala in forum New To JavaReplies: 6Last Post: 01-23-2011, 04:40 PM -
User Defined Method
By overcranked in forum New To JavaReplies: 6Last Post: 04-09-2010, 01:02 AM -
JSP with user-defined java classes
By adammyth in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 03-05-2010, 06:13 PM -
What is an Immutable Class
By maheshkanda in forum New To JavaReplies: 3Last Post: 02-06-2009, 08:12 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks