Question: I have created a linked list called studentlinkedlist but when I use the toString method I created to print it only prints one element and
D student.java | D StudentMainjava ID StudentLinkedListjava 2 public class StudentMain t 3 static StudentLinkedList studentlist; 5e public static void main(String[] args) { Student student new Student("John, "Doe", "doelj") studentlist new StudentlinkedList(student); System.out.println(studentlist.sizeO) student new Student John", "Deer", "deer1j") studentList.add(student); System.out.println(studentlist.sizeO) System.out.printlnO; 10 12 13 14 15 16 17 18 19 20 21 System.out.println(studentList.toStringO):// prints students in list System.out.printlnO System. out.print(student.getFnameO+// gets first name of student System.out.printIn(student.getLnameOD:// gets last name of student Problems Javadoc Declaration Search Console cterminated> StudentMain (Java Application) ALibrary/Java/JavaVirtual Machines/idk1.8.0 144 jdk/Contents/Home/bir John, Doe,doe1j,e John Deer Ap
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
