Skip to content

Instantly share code, notes, and snippets.

@Tefferson
Created September 15, 2015 22:09
Show Gist options
  • Save Tefferson/f3d80b9bb64d3a045389 to your computer and use it in GitHub Desktop.
Save Tefferson/f3d80b9bb64d3a045389 to your computer and use it in GitHub Desktop.
public class Elfo {
private String nome;
private int flechas;
private int experiencia;
public Elfo(String n, int flech) {
nome = n;
flechas = flech;
experiencia = 0;
}
public void atirarFlecha() {
flechas--;
experiencia++;
}
}
public class Elfo {
private String nome;
private int flechas;
private int experiencia;
public Elfo(String n, int flech) {
nome = n;
flechas = flech == 0 ? 42 : flech;
experiencia = 0;
}
public void atirarFlecha() {
flechas--;
experiencia++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment