Created
April 13, 2019 13:02
-
-
Save DiegoAscanio/474bac118ad02a0756777bb70862f3c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Pessoa { | |
private String nome; | |
private Pessoa pai; | |
private Pessoa mae; | |
public Pessoa(String nome, Pessoa pai, Pessoa mae) { | |
this.nome = nome; | |
this.pai = pai; | |
this.mae = mae; | |
} | |
public boolean equals (Pessoa pessoa) { | |
String meuNome = this.nome; | |
Pessoa minhaMae = this.mae; | |
} | |
public boolean sãoIrmãs (Pessoa pessoa) { | |
Pessoa meuPai = this.pai; | |
Pessoa minhaMae = this.mae; | |
} | |
private boolean ePai (Pessoa pessoa) { | |
Pessoa meuPai = this.pai; | |
} | |
private boolean eMae (Pessoa pessoa) { | |
} | |
private boolean eAvoMaterna (Pessoa pessoa) { | |
Pessoa minhaMae = this.mae; | |
Pessoa minhaAvoMaterna = minhaMae.mae; | |
} | |
private boolean eAvoMaterno (Pessoa pessoa) { | |
} | |
private boolean eAvoPaterna (Pessoa pessoa) { | |
} | |
private boolean eAvoPaterno (Pessoa pessoa) { | |
} | |
public boolean eAntecessor (Pessoa pessoa) { | |
if (this.eMae(pessoa) == true || | |
this.ePai(pessoa) == true || | |
this.eAvoMaterna(pessoa) == true || | |
this.eAvoMaterno(pessoa) == true || | |
this.eAvoPaterna(pessoa) == true || | |
this.eAvoPaterno(pessoa) == true ) { | |
return true; | |
} | |
else { | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment