| Author |
comparing character in java: uppercase, lowercase, or symbol?
|
mark donner
Greenhorn
Joined: Oct 08, 2011
Posts: 17
|
|
Hi
I am trying to learn java. What is wrong with my code below. Thank you very much for your help!
(program is for java to tell what kind of character it is)
[Edit: added code tags - MB]
|
 |
Chiranjeevi Kanthraj
Ranch Hand
Joined: Feb 18, 2008
Posts: 283
|
|
You can not compare the char with the String , "A" is a String not a char ('A')
Please follow the posting guideline
Below code can solve your problem
|
-Chiru
|
 |
John Jai
Bartender
Joined: May 31, 2011
Posts: 1776
|
|
|
And do please UseCodeTags henceforth
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3791
|
|
|
You might want to look more carefully at those if statements - there's an error in the logic.
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
Welcome to JavaRanch
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32654
|
|
|
Read carefully through the Character class; you may find something very useful for your problem there.
|
 |
mark donner
Greenhorn
Joined: Oct 08, 2011
Posts: 17
|
|
Thank you very much for everyone's help. Sorry about not doing the codetags.
What wrong with the logic?
thank you
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3791
|
|
mark donner wrote:What wrong with the logic?
You sure those should both be "<="?
|
 |
 |
|
|
subject: comparing character in java: uppercase, lowercase, or symbol?
|
|
|