Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

java single link list class LinkList1 { public Link head; public LinkList1(){ head=null; } public void insertfirst(int data){ Link newLink= new Link(data, head); head=newLink; } public Link search (int key){ if (head=null); System.out.println("empty list"); return null; Link current=head; while (current.getData!=key) { if (current.next==null) return null; else current=current.next;

OpenStudy (e.mccormick):

What problem are you having?

OpenStudy (rsmith6559):

if (head=null); A single equal sign is for assignment, comparison uses a double equal sign. If statements don't have a semi-colon. More than one line in an if stanza should have braces around them.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!