Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 not two. Can someone help? image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions

Question

What is the use of bootstrap program?

Answered: 1 week ago

Question

What is a process and process table?

Answered: 1 week ago

Question

What is Industrial Economics and Theory of Firm?

Answered: 1 week ago