-
-
Save uncoded-ro/37690c04881cd539b5b6521878a31af6 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.set; | |
import java.util.*; | |
import ro.virtualcampus.person.Student; | |
public class CatalogSet { | |
private String anStudiu; | |
private HashSet<Student> studenti; | |
public CatalogSet(String anStudiu) { | |
this.anStudiu = anStudiu; | |
this.studenti = new HashSet<Student>(); | |
} | |
public String getAnStudiu() { | |
return this.anStudiu; | |
} | |
public void setAnStudiu(String anStudiu) { | |
this.anStudiu = anStudiu; | |
} | |
public HashSet<Student> getStudenti() { | |
return this.studenti; | |
} | |
public void setStudenti(HashSet<Student> studenti) { | |
this.studenti = studenti; | |
} | |
public void afisareStudenti() { | |
System.out.println("anul de studiu " + this.anStudiu + " are " + | |
this.studenti.size() + " studenti"); | |
System.out.println(this.studenti); | |
} | |
public void transferStudenti(HashSet<Student> studenti) { | |
this.studenti.addAll(studenti); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment