Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Ron McLeod
paul wheaton
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Himai Minh
Bartenders:
Forum:
Java in General
How to create immutable classes
manish basotia
Ranch Hand
Posts: 47
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please reply fast
Erik Pragt
Ranch Hand
Posts: 125
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
public class Immutable { private String name; public Immutable(String name) { this.name = name; } }
Very easy
Scotty Sinclair
Greenhorn
Posts: 17
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 13459
I like...
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Check the javaRanch Journal:
Mutable and Immutable Objects
Dave.
John O'Hanley
Greenhorn
Posts: 24
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Here is some good info on immutable object:
http://www.javapractices.com/Topic29.cjp
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
immutable class
help with this q
Immutable class
How to make Date Immutable
immutable
More...