• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Delimiter help please

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Avengers,Joss Whedon,9.0
Panday,Carlo J. Caparas,6.9
Les Miserables,Tom Hooper,7.9

i'm suppose to add those above things from a text file to an arraylist.

and to add those to an arraylist the methods required goes at






I think here is my problem..




am i using the delimiter right to get the movie title, movie director, rating correct?
because of addMovie(String title, String director, double rating) . so if i want to add Avengers,Joss Whedon,9.0 should i use a delimeter
or is there an easier way..
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, please UseCodeTags (⇐Click)

I would abandon the useDelimiter() method of Scanner. Instead read in a whole line (which you are doing already) and use the split() of the String class to divide the line into pieces.
 
She'll be back. I'm just gonna wait here. With this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic