Java Reference
In-Depth Information
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
protected long getId() {
return id;
}
protected void setId(long id) {
this.id = id;
}
}
Listing 3-10. The Class Representing Adverts (Each Instance Has an Associated User Who Placed
the Advert)
package sample.entity;
public class Advert {
private long id;
private String title;
private String message;
private User user;
public Advert(String title, String message, User user) {
this.title = title;
this.message = message;
this.user = user;
}
Advert() {
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
Search WWH ::




Custom Search