File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comparing character in java: uppercase, lowercase, or symbol?

 
mark donner
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 290
Hibernate Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
John Jai
Rancher
Posts: 1776
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And do please UseCodeTags henceforth
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to look more carefully at those if statements - there's an error in the logic.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch
 
Campbell Ritchie
Sheriff
Pie
Posts: 47289
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read carefully through the Character class; you may find something very useful for your problem there.
 
mark donner
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for everyone's help. Sorry about not doing the codetags.

What wrong with the logic?

thank you
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mark donner wrote:What wrong with the logic?
You sure those should both be "<="?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic