aspose file tools*
The moose likes Beginning Java and the fly likes question, please help. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "question, please help." Watch "question, please help." New topic
Author

question, please help.

christopher persinger
Greenhorn

Joined: Aug 23, 2005
Posts: 20
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

Joined: Oct 10, 2003
Posts: 21
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

Joined: Aug 10, 2005
Posts: 685
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

Joined: Jul 22, 2000
Posts: 9044
    
  10
Where do you declare that correct is a boolean?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question, please help.