We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
What am i doing wrong, can someone pls help me identify
Priorities
classPriorities{privatePriorityQueue<Student>students=newPriorityQueue<>(1000);publicList<Student>getStudents(List<String>events){events.forEach(event->{if(event.startsWith("ENTER")){String[]studentDetails=event.split(" ");Integerid=Integer.valueOf(studentDetails[3]);Stringname=studentDetails[1];Doublecgpa=Double.valueOf(studentDetails[2]);students.offer(newStudent(id,name,cgpa));}elseif(event.equals("SERVED")){students.poll();}});List<Student>stdLst=newArrayList<>();students.forEach(student->stdLst.add(student));// return new ArrayList<>(students);returnstdLst;}}}
Java Priority Queue
You are viewing a single comment's thread. Return to all comments →
What am i doing wrong, can someone pls help me identify
Priorities
Student