l = phrase.charAt(i);
First you need to change the name of the variable that is assigned the value returned by the charAt() method.
l is not a good variable name. It is hard to talk about the...
Type: Posts; User: Norm
l = phrase.charAt(i);
First you need to change the name of the variable that is assigned the value returned by the charAt() method.
l is not a good variable name. It is hard to talk about the...
The code doesn't appear to be testing the value of the char variable assigned the value returned by charAt().
BTW l is a very poor variable name. It looks too much like the digit 1. In general...
'1' is a char and "1" is a String. Their values are not the same as the int: 1.
The charAt() method returns a char like '1', it does NOT return an int value like 1.
Change the code to work with...
All the input are char values. None of the input is int. The char: '1' or the String: "1" does not have the same value as the int: 1.
To see the values of the characters, look at an ASCII...
Looks like the output is missing the leading h and the ending numbers.
Try debugging the code by adding some println statements that print out the values of variables as they are changed so you...
Please copy and post the console contents that shows what was input to the program and what it printed out.
Does it execute and give you the desired results?