• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
  • Himai Minh
  • Carey Brown
  • salvin francis

LinkedList question

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I need to test the methods in this code. In the Main method I need to create a list of strings of however many I want, ex 5, and then test the methods in the code provided, except the iterator one. I also need to be able to print the list, iteratively somehow? I just can't figure out how to start the main, would someone be able to give me an example of how to test one of the methods? I could probably figure the rest out then. Thanks!

I also posted here, http://www.java-forums.org/new-java/83655-linkedlist-question.html#post362584
Posts: 71045
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have removed a lot of blank lines from your code. there is no need for blanks after every line; in fact I think that makes the code harder to read.
Actually I would move the main method out of that class altogether. Put it into another class, maybe ListDemoYou should add lots more code to the start method, to demonstrate your List working. If you are not familiar with command‑line arguments, start here. You can run it like this:-

javac ListDemo java
java ListDemo Campbell is no help at all when you run into trouble

The parameter args now receives a String[] {"Campbell", "is", "no", "help", "at", "all", "when", "you", "run", "into", "trouble}
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic