File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

question, please help.

christopher persinger

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

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?

Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 692
I assume that correct is a boolean.

is sufficent, you don't need to test it with a comparison: correct == true
Marilyn de Queiroz

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

"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:
subject: question, please help.
It's not a secret anymore!