Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package estruturacaelum;
- public class Aluno {
- private String nome;
- public String getNome() { //retorna nome
- return nome;
- }
- public void setNome(String nome) { //muda nome
- this.nome = nome;
- }
- @Override
- public String toString() {//mostra lista
- return this.nome;
- }
- @Override
- public boolean equals(Object o) {//comparação entre os nomes
- Aluno outro = (Aluno)o;
- return this.nome.equals(outro.nome);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment