Skip to content

Instantly share code, notes, and snippets.

@guaracyalima
Last active November 24, 2019 21:41
Show Gist options
  • Save guaracyalima/2e0fc41794cf834a7daf9f8f94c19669 to your computer and use it in GitHub Desktop.
Save guaracyalima/2e0fc41794cf834a7daf9f8f94c19669 to your computer and use it in GitHub Desktop.
E3 {
int number;
public E3 (int number){
this.number = number;
}
int getNumber(){
return this.number;
}
void setNumber(int number){
this.number = number;
}
void addTree (E3 value){
System.out.println("Valor incial" + value.getNumber());
value.setNumber(value.getNumber() + 3);
System.out.println("Saida inicial " + value.getNumber());
}
public static void main(String[] args) {
E3 e = new E3(1);
System.out.println("Primeira chamada " + e.getNumber());
e.addTree(e);
System.out.println("Segunda chamada " + e.getNumber());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment