Help! I am brand new to Java and I need help!
I am taking an AP Computer Science course and I am very confused about one particular question on a quiz. Can somebody please explain why the answer is 32? Thank you so much for your time.
Put a number in the blank so that this coding counts the number of tabs, blanks, newlines, form feeds, and other special characters in the first 10 characters of a String named s.
for (int k = 0; k < 10 ; k++)
if ((int) s.charAt (k) <= ________________ )
Re: Help! I am brand new to Java and I need help!
That is a poor coding technique to use 32 vs the char value that the problem talks about.
Look at the ASCII codes table to see what values are at or below the blank character.
The correct value for the code is ' ' (there is a blank/space between the 's
if ( s.charAt (k) <= ' ')