Skip to content

Instantly share code, notes, and snippets.

@uncoded-ro
Created January 12, 2020 12:41
Show Gist options
  • Save uncoded-ro/a0cf75da19ae20412336c9f205f29b7b to your computer and use it in GitHub Desktop.
Save uncoded-ro/a0cf75da19ae20412336c9f205f29b7b to your computer and use it in GitHub Desktop.
package ro.virtualcampus.person;
public class Persoana {
private String nume;
private int varsta;
private double inaltime;
public Persoana() {
this("Necunoscut", 0, 0.0);
}
public Persoana(String nume, int varsta, double inaltime) {
this.nume = nume;
this.varsta = varsta;
this.inaltime = inaltime;
}
public Persoana(String nume) {
this(nume, 0, 0.0);
}
public String getNume() {
return this.nume;
}
public int getVarsta() {
return varsta;
}
public double getInaltime() {
return inaltime;
}
public void sePrezinta() {
System.out.printf("Numele meu este %s.%n", this.nume);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment