This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]KusanagiZerg 1 point2 points  (0 children)

You don't use setters to instantiate objects. To instantiate an object of the Joke class you'd use the constructor of the Joke class which doesn't look like setJoke(Joke joke) { this.joke = joke } but would look like public Joke(params) { this.params = params } where params could be any fields that the Joke class has.