import java.util.ArrayList;
class Ideone {
public static void main
(String[] args
) { ArrayList<Pessoa> pessoas = new ArrayList<>();
pessoas.add(new Pessoa(1, "joão", 'M', "9999-9999"));
pessoas.add(new Pessoa(2, "maria", 'F', "9999-9991"));
for (Pessoa pessoa : pessoas) {
System.
out.
println(pessoa.
getNome()); }
}
}
class Pessoa {
private int id;
private char sexo;
this.id = id;
this.nome = nome;
this.sexo = sexo;
this.telefone = telefone;
}
public int getId(){ return this.id; }
public void setId(int id){ this.id = id; }
public String getNome
(){ return this.
nome; } public void setNome
(String nome
){ this.
nome = nome
; }
public char getSexo(){ return this.sexo; }
public void setSexo(char sexo){ this.sexo = sexo; }
public String getTelefone
(){ return this.
telefone; } public void setTelefone
(String telefone
){ this.
telefone = telefone
;}
}
aW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7CgpjbGFzcyBJZGVvbmUgewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpCXsKCQlBcnJheUxpc3Q8UGVzc29hPiBwZXNzb2FzID0gbmV3IEFycmF5TGlzdDw+KCk7CgkJcGVzc29hcy5hZGQobmV3IFBlc3NvYSgxLCAiam/Do28iLCAnTScsICI5OTk5LTk5OTkiKSk7CgkJcGVzc29hcy5hZGQobmV3IFBlc3NvYSgyLCAibWFyaWEiLCAnRicsICI5OTk5LTk5OTEiKSk7CgkJZm9yIChQZXNzb2EgcGVzc29hIDogcGVzc29hcykgewoJCQlTeXN0ZW0ub3V0LnByaW50bG4ocGVzc29hLmdldE5vbWUoKSk7CgkJfQoJfQp9CgpjbGFzcyBQZXNzb2EgewoKICAgIHByaXZhdGUgaW50IGlkOwogICAgcHJpdmF0ZSBTdHJpbmcgbm9tZTsKICAgIHByaXZhdGUgY2hhciBzZXhvOwogICAgcHJpdmF0ZSBTdHJpbmcgdGVsZWZvbmU7CgogICAgUGVzc29hKGludCBpZCwgU3RyaW5nIG5vbWUsIGNoYXIgc2V4bywgU3RyaW5nIHRlbG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