Trabalho simples - sisteminha de "cadastro" em java

Page 5

this.ra = ra; } public long getRa() { return ra; } public void setRa(long ra) { this.ra = ra; } @Override public String toString() { return "nome: " + getNome() + ", cpf: " + getCpf() + ", idade: " + getIdade() + ", RA: " + ra + "."; } @Override public int compareTo(Object obj) { Aluno aluno = (Aluno) obj; int resp = this.getNome().compareTo(aluno.getNome()); if (resp != 0) { return resp; } else if (this.getRa() < aluno.getRa()) { return -1; } else if (this.getRa() > aluno.getRa()) { return 1; } else { return 0; } } @Override public boolean equals(Object obj) { return super.equals(obj); } }


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.