I'm trying to separate out the first name, last name, and the 3 sections of numbers. So far I have:
public Customer (String customerInfo)
{
firstName = customerInfo.indexOf(' ');
lastName = customerInfo.indexOf(' ', '/');
}
I know I should have more there, but I can't even get that to compile. When I try I get the following error:
C:\Documents and Settings\Brad\Desktop\CSE\Customer.java:40: incompatible types
found : int
required: java.lang.String
firstName = customerInfo.indexOf(' ');
^
C:\Documents and Settings\Brad\Desktop\CSE\Customer.java:41: incompatible types
found : int
required: java.lang.String
lastName = customerInfo.indexOf(' ', '/');
I'm pretty sure that I'm not using the indexOf method even remotely correct. Any help at all would be appreciated.
This post has been edited by Bradwick: 31 March 2007 - 11:38 PM

New Topic/Question
Reply




MultiQuote





|