Hey guys, I have been having a problem with converting an interger into string for input purposes. For example, I am trying to make it so when the user inputs his/her name and it is an integer the program will not accept it. The IBIO file is the input method my class is using.

String name = IBIO.inputString ("What is the students name? >");
int b = Integer.parseInt (name);


while ((b > 0) ||(name.compareTo ("0") == 0))
{
System.out.println("INVALID ENTRY. Please enter a valid Name.");
}

Whenever I run the program i have a converting problem which does not allow my while statement to iniatlize. The problem is that "java.lang.string cannot be assigned an interger value."

Help would be appreciated!

THANKS

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.