Hello everyone!
I'm new to java and I got a test today and kind of failed to make it, I was hoping that someone could explain it to me because I still don't get how to use Generic collections....
this is what I got and we had to make the proper classes to get this output:
Room 11 has H. DS as it's teacher
Felix De Vliegher follows basis
Koen Vanhoutte follows java
Serge Vereecke follows java
Freddy Himpe follows .net
Room 11 has H. DS as it's teacher
There are 4 cursisten
Felix De Vliegher follows C++
Serge Vereecke follows java
Freddy Himpe follows .net
Alexandra Blondeel follows java
public class Main { public static void main(String[] args) { Traject traject1 = new Traject ("C++"); Traject traject2 = new Traject ("java"); Traject traject3 = new Traject (".net"); Traject traject4 = new Traject ("basis"); Cursist cursist1 = new Cursist ("Felix", "De Vliegher", traject4); Cursist cursist2 = new Cursist ("Koen", "Vanhoutte", traject2); Cursist cursist3 = new Cursist ("Serge", "Vereecke", traject2); Cursist cursist4 = new Cursist ("Freddy", "Himpe", traject3); Instructeur instructeur = new Instructeur("H.","DS"); Room room = new Room(11,instructeur); room.cursistAdd(cursist1); room.cursistAdd(cursist2); room.cursistAdd(cursist3); room.cursistAdd(cursist4); System.out.println(lokaal); cursist1.setTraject(traject1); Cursist cursist5 = new Cursist("Alexandra","Blondeel", traject2); lokaal.cursistToevoegen(cursist5); lokaal.cursistVerwijderen(cursist2); System.out.println(lokaal); } }
what I tried to make is this:
make 4 new classes(Traject, Room, Instructeur, cursist)
I have no idea how to fill these classes.... My problem is the fact that I don't know the syntax and don't know how to use generics if someone could explain this to me it would be great!!!
Thank you