-
-
Save uncoded-ro/f125c5f658cdb82902f2cc4c94943bff 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 java.io.IOException; | |
import ro.virtualcampus.unit.Facultate; | |
public class Student extends Persoana { | |
private Facultate facultate; | |
private int anStudiu; | |
public Student(String nume, int varsta, Facultate facultate, int anStudiu) { | |
super(nume, varsta); | |
this.facultate = facultate; | |
this.anStudiu = anStudiu; | |
} | |
public Student(String obj) throws IOException { | |
super(obj); | |
facultate = new Facultate(null, null); | |
System.out.print("nume facultate: "); | |
this.facultate.setNume(in.readLine()); | |
System.out.print("adresa facultate: "); | |
this.facultate.setAdresa(in.readLine()); | |
System.out.print("an studiu: "); | |
this.anStudiu = Integer.parseInt(in.readLine()); | |
} | |
public Facultate getFacultate() { | |
return facultate; | |
} | |
public void setFacultate(Facultate facultate) { | |
this.facultate = facultate; | |
} | |
public int getAnStudiu() { | |
return anStudiu; | |
} | |
public void setAnStudiu(int anStudiu) { | |
this.anStudiu = anStudiu; | |
} | |
@Override | |
public String toString() { | |
return "Student [facultate=" + facultate + ", anStudiu=" + anStudiu | |
+ ", nume=" + nume + ", varsta=" + varsta + "]"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment