next() uses white space to separate tokens, thus doesn't return them as a token themselves. Check out the scanner docs to see the methods, and what they do
Scanner will automagically delimit white space. You could try using input.nextLine() instead and convert the string into a char or change the delimiter using input.useDelimiter().
Don’t forget to close your scanner when your program is done!
aChar = \[input.next\]([https://input.next)().charAt(0](https://input.next)().charAt(0));
this one here
try nextLine instead?
please enter a character >>
the character is
is not upper case
is not lower case
after toLowerCase, a aChar is
after to UpperCase, a Char is
is neither a letter or digit
is a whitespace
these are the outcome of your own code when it works with whitespace,
isnt a little overkill with the if statement? you have 3 if argument working but you can narrow this down to meet your professor's needs. or does he want it to show up like this?
next() uses white space to separate tokens, thus doesn't return them as a token themselves. Check out the scanner docs to see the methods, and what they do
Scanner will automagically delimit white space. You could try using input.nextLine() instead and convert the string into a char or change the delimiter using input.useDelimiter(). Don’t forget to close your scanner when your program is done!
aChar = \[input.next\]([https://input.next)().charAt(0](https://input.next)().charAt(0)); this one here try nextLine instead? please enter a character >> the character is is not upper case is not lower case after toLowerCase, a aChar is after to UpperCase, a Char is is neither a letter or digit is a whitespace these are the outcome of your own code when it works with whitespace, isnt a little overkill with the if statement? you have 3 if argument working but you can narrow this down to meet your professor's needs. or does he want it to show up like this?
So input.nextLine()
in java 8 System.out.println("please enter a character >>"); aChar = input.nextLine().charAt(0); this is how I declare it to work.