Skip to content

Instantly share code, notes, and snippets.

@stephanos
Created October 28, 2012 08:35
Show Gist options
  • Save stephanos/3968069 to your computer and use it in GitHub Desktop.
Save stephanos/3968069 to your computer and use it in GitHub Desktop.
public class ClassDeclarationSyntaxInJava {
public abstract class AbstractDTO {
private final Long id;
public AbstractDTO(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}
public class CustomerDTO extends AbstractDTO {
private String name;
private List<String> roles;
public CustomerDTO(Long id, String name, List<String> roles) {
super(id);
this.name = name;
this.roles = roles;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<String> getRoles() {
return roles;
}
public void setRoles(List<String> roles) {
this.roles = roles;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment