This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question, please help.

 
christopher persinger
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, below is a piece of code from my current program. I have created 2 scanners. The first scanner opens the customer.txt file, reads a line, and then passes that line to my second scanner. My second scanner is going to parse the lines by using a comma as the dilimeter and only accept lines with the three things i want (last name, first name, and email address). When I find a line with the three things i want and no more, i want to then create a Customer object from my Customer class so that I can insert it in an arraylist. But when I try to compile the code below, it gives me an error and tells me that: Customer C1 = new Customer(lastName, firstName, email) is not a statement? What do I need to do? Thanks for the help in advance!


 
Rick Goldstein
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I note that in the final conditional (the if (...) on the next to last line) you are using = (assignment), rather than == (comparison). Could that be the problem?

Also, why not use the split() function of String?

Rick
 
Norm Radder
Ranch Hand
Posts: 707
3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume that correct is a boolean.

Then
is sufficent, you don't need to test it with a comparison: correct == true
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where do you declare that correct is a boolean?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic