-
-
Save uncoded-ro/b20a93cb4412d6e6425408ab388f6873 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
package ro.virtualcampus.person; | |
import ro.virtualcampus.eval.IPoateEvalua; | |
import ro.virtualcampus.eval.IPoateFiEvaluat; | |
public class Persoana implements IPoateEvalua, IPoateFiEvaluat { | |
protected static int nrPersoane = 0; | |
protected String nume; | |
protected int varsta; | |
public Persoana() { | |
nrPersoane++; | |
this.nume = "necunoscut"; | |
this.varsta = 0; | |
} | |
public Persoana(int varsta) { | |
this(); | |
this.varsta = varsta; | |
} | |
public Persoana(String nume, int varsta) { | |
nrPersoane++; | |
this.nume = nume; | |
this.varsta = varsta; | |
} | |
public static int getNrPersoane() { | |
return nrPersoane; | |
} | |
public void setNume(String nume) { | |
this.nume = nume; | |
} | |
public String getNume() { | |
return nume; | |
} | |
public void setVarsta(int varsta) { | |
this.varsta = varsta; | |
} | |
public int getVarsta() { | |
return varsta; | |
} | |
@Override | |
public String toString() { | |
return "Persoana [nume=" + nume + ", varsta=" + varsta + "]"; | |
} | |
@Override | |
public void esteEvaluat() { | |
System.out.println(String.format("Persoana %s este evaluata.", getNume())); | |
} | |
@Override | |
public void evalueaza() { | |
System.out.println(String.format("Persoana %s evalueaza.", getNume())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment