-
-
Save uncoded-ro/e777c8875a8367fe603ba404477f5f41 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; | |
public class Student extends Persoana { | |
private double medie; | |
private String facultate; | |
public Student() { | |
super(); | |
this.medie = 0.0; | |
this.facultate = null; | |
} | |
public Student(String nume, int varsta, double inaltime, double medie, String facultate) { | |
super(nume, varsta, inaltime); | |
this.medie = medie; | |
this.facultate = facultate; | |
} | |
public double getMedie() { | |
return medie; | |
} | |
public String getFacultate() { | |
return facultate; | |
} | |
@Override | |
public void sePrezinta() { | |
super.sePrezinta(); | |
System.out.printf("Sunt student la facultatea %s.%n", getFacultate()); | |
} | |
public void sePrezinta(String salut) { | |
System.out.printf("%s! ", salut); | |
this.sePrezinta(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment