Što predstavlja sljedeći kod?
Što mora postojati i s kojim parametrima da bi ovaj dio koda bio ispravan?
class DrugiZimskiRok{
public static void main (String args[])
{
Profesor[] profesori = new Profesor[3];
profesori[0] =new Profesor("A", "A", "201", "Financije");
profesori[1] =new Profesor("S", "S","208", "Marketing");
profesori[2] =new Profesor("B", "B", "305", "UIS");
Profesor prof1 = profesori[0];
Profesor prof2 = profesori[1];
Profesor prof3 = profesori[2];
Student[] studenti = new Student[3];
studenti[0] =new Student("M", "M","45784", "Informatika", prof3);
studenti[1]=new Student("D", "D","47745", "Informatika", prof3);
studenti[2]=new Student("J", "J","49984", "Financije",prof1);
Što mora postojati i s kojim parametrima da bi ovaj dio koda bio ispravan?
class DrugiZimskiRok{
public static void main (String args[])
{
Profesor[] profesori = new Profesor[3];
profesori[0] =new Profesor("A", "A", "201", "Financije");
profesori[1] =new Profesor("S", "S","208", "Marketing");
profesori[2] =new Profesor("B", "B", "305", "UIS");
Profesor prof1 = profesori[0];
Profesor prof2 = profesori[1];
Profesor prof3 = profesori[2];
Student[] studenti = new Student[3];
studenti[0] =new Student("M", "M","45784", "Informatika", prof3);
studenti[1]=new Student("D", "D","47745", "Informatika", prof3);
studenti[2]=new Student("J", "J","49984", "Financije",prof1);
Tachno, nisam to primetio... Ispravi taj konstruktor klase Student npr. ovako: