05-07-2009, 03:13 PM
|
#2 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Tanax
Hiya, again!
I'm here with another Java problem.
I have a Bank program, and an add button, which would let you add a customer to the Bank. Problem is, that I need the social security number to be of the type "long".
Currently looks like this:
Code:
public Boolean addCustomer_logic()
{
String number = this.addCustNumber_textfield.getText();
String name = this.addCustName_textfield.getText();
int nr = Integer.parseInt(number);
return this.logic.addCustomer(nr, name);
}
As you see, I'm parsing Int. How can I convert an input string to long??
|
Would this work?
long nr = Long.parseLong(number);
|
|
|
|