The objects which will not be changed too frequently then simply accessed should be made immutable. Though some utility functions can be provided to make changes. But the attributes should not be changed by the programmer once it has been set by the constructor.
To make a class' objects immutable, don't provide any setter methods.
A simple example is the String class of java API.
To make a class' objects immutable, don't provide any setter methods.
A simple example is the String class of java API.
0 Comments On This Entry
← January 2022 →
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 |
My Blog Links
Recent Entries
-
-
-
SCJP Notes - Part 6on Mar 27 2008 08:19 AM
-
SCJP Notes - Part 5on Mar 27 2008 08:05 AM
-
Recent Comments
Search My Blog
13 user(s) viewing
13 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)



Leave Comment









|