Immutable objects
How to wrire a class which produces immutable objects
How to wrire a class which produces immutable objects
> How to wrire a class which produces immutable objects
Homework assignment?
what does immutable mean to you? Removing what in Java makes an Object immutable?
Don't expose any mutators. But I wouildn't just quote that directly in your homework because unless you understand what that means it'll be obvious you cheated
> How to wrire a class which produces immutable objects
Assuming "wrire" means "write", here's a class that produces immutable objects.
public class ImmutableObjectFactory {
public Object produceImmutableObject() {
return new Object();
}
}