All pastes #2091544 Raw Edit

Unnamed

public java v1 · immutable
#2091544 ·published 2011-10-19 17:58 UTC
rendered paste body
public class testacomparable implements Comparable{    private String nome;    private int idade;    private double salario;    //construtor    public testacomparable(String n, int i, double s){        nome = n;        idade = i;        salario = s;    }    //getters and setters    public String getNome() { return nome; }    public int getIdade(){ return idade; }    public double getSalario(){ return salario; }    public void setNome(String n) { nome = n; }    public void getIdade(int i) {idade=i; }    public void setSalario(double s) {salario = s;}        @Override    public String toString(){        String s = "Nome: "+nome+" Idade: "+idade+" Salário: "+salario;        return s;    }    @Override    public int compareTo(Object t) {        testacomparable aux = (testacomparable)t;        if    }}