Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ImmutableObject {
- private final String string;
- private final Date date;
- public ImmutableObject(String string, Date date) {
- this.string = string;
- this.date = date;
- }
- public Date getDate() {
- return new Date(date.getTime());
- }
- public String getString() {
- return string;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement