Remember
Register
1
new
Chill
new
Puzzles
new
GK
new
Sports
new
Business
Home
Questions
MCQs
Unanswered
Tags
Users
Ask a Question
Write Article
Articles
Connect to us
Java:Can we create a user defined immutable class like String?
+1
vote
464
views
Java:Can we create a user defined immutable class like String?
java
posted
Sep 5, 2013
by
Vinay Shukla
Share this question
Your comment on this post:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
1 Answer
0
votes
Yes,by making the class final and its data members as private,final.
answer
Sep 5, 2013
by
Arvind Singh
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Your answer
Preview
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Similar Questions
0
votes
How can we create immutable class in java?
+2
votes
Why in Java design String class is made as a immutable class?
+1
vote
Java: Why is String class considered immutable while StringBuffer are mutable?
0
votes
How many ways we can create the string object in java?
+2
votes
How many ways we can write Singleton Class in Java and how to create thread-safe Singleton?
...