import java.util.*;
import java.lang.*;
class HelloWorld{
ArrayList<Pessoa> listaDePessoas = new ArrayList<>();
listaDePessoas.add(new Pessoa("Joao", 29));
listaDePessoas.add(new Pessoa("Ana", 21));
listaDePessoas.add(new Pessoa("Maria", 25));
Pessoa pessoaAlterada = listaDePessoas.get(0).clone();
listaDePessoas.get(0).setNome("Jao carlos");
Pessoa pessoaRemovida = listaDePessoas.remove(2);
}
}
public String getNome
() { return nome
; } public void setNome
(String nome
) { this.
nome = nome
; } private int idade;
public int getIdade() { return idade; }
public void setIdade(int idade) { this.idade = idade; }
public Pessoa
(String nome,
int idade
) { this.nome = nome;
this.idade = idade;
}
return (Pessoa)super.clone();
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CgpjbGFzcyBIZWxsb1dvcmxkewogICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZyBbXWFyZ3MpIHRocm93cyBDbG9uZU5vdFN1cHBvcnRlZEV4Y2VwdGlvbiB7CiAgICAgICAgQXJyYXlMaXN0PFBlc3NvYT4gbGlzdGFEZVBlc3NvYXMgPSBuZXcgQXJyYXlMaXN0PD4oKTsKICAgICAgICBsaXN0YURlUGVzc29hcy5hZGQobmV3IFBlc3NvYSgiSm9hbyIsIDI5KSk7CiAgICAgICAgbGlzdGFEZVBlc3NvYXMuYWRkKG5ldyBQZXNzb2EoIkFuYSIsIDIxKSk7CiAgICAgICAgbGlzdGFEZVBlc3NvYXMuYWRkKG5ldyBQZXNzb2EoIk1hcmlhIiwgMjUpKTsKICAgICAgICBQZXNzb2EgcGVzc29hQWx0ZXJhZGEgPSBsaXN0YURlUGVzc29hcy5nZXQoMCkuY2xvbmUoKTsKICAgICAgICBsaXN0YURlUGVzc29hcy5nZXQoMCkuc2V0Tm9tZSgiSmFvIGNhcmxvcyIpOwogICAgICAgIFBlc3NvYSBwZXNzb2FSZW1vdmlkYSA9IGxpc3RhRGVQZXNzb2FzLnJlbW92ZSgy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