0

hi all

i am doing a programing and got stuck on two condition. here is the code that I have done so far. it is as far as i reach.

for(int i=1; i<=3; i++){

           System.out.println("please enter the employee id number");
           emp_idnum = input.nextInt();

           System.out.println("please enter the employee first name");
           empfirst_name = input.next();

           System.out.println("please enter the employee last name");
           emplast_name = input.next();


           public class inputChar()am now getting an error is when i put the semi-colon at the end of the statemnt

           if(inputChar.Equals.('F') || inputChar.Equal('f')){- got a red line that tells me to create a field called public class and when i did

can u tell me what I am missing here.thanks in advance

5
Contributors
12
Replies
45
Views
2 Years
Discussion Span
Last Post by divinity02
Featured Replies
  • 1

    divinity: don't read noobz32 's response, or, since you did, ignore it. it is wrong. read James' remark instead. if you read it as a String, use the equals (not Equals) or equalsIgnoreCase method to compare them. if you read your input as a char, use the == operator to … Read More

0

Your code as shown is not correct/valid and you aren't showing enough information, such as your class definitions. Are you trying to define a class inside another one?

0

Time to go back to the text book. This is not rocket science, and since you have to ask that question, you haven't been doing your homework... :-(

0

It looks like inputChar is supposed to be a char that the user inputs? That's not a class that you need to define. It's just like the int and String variables that you have already defined and read from the user.

Edited by JamesCherrill

-1

inputChar.Equals.('F') is incorrect, equals method is on intended for string only not for characters

Comments
equals is defined in Obect - applies to every class
1

divinity: don't read noobz32 's response, or, since you did, ignore it. it is wrong.

read James' remark instead. if you read it as a String, use the equals (not Equals) or equalsIgnoreCase method to compare them. if you read your input as a char, use the == operator to compare the values.

0

hi j

can u please answer me this question. if yuh have ah staement such as this one

inputChar = input.next().CharAt(0);

an u are getting an error underneath the charAt(0), what does does mean and how do u fix it and it is telling u cannot find symbol

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.