File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes comparing chars Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "comparing chars" Watch "comparing chars" New topic

comparing chars

Erkki Veps�l�inen

Joined: Feb 10, 2004
Posts: 9
How can I compare if two chars are the same, "equals" doesn't work here.
David Peterson
Ranch Hand

Joined: Oct 14, 2001
Posts: 154
Since chars are primitives and not objects, you can use == to compare them.
Vicken Karaoghlanian
Ranch Hand

Joined: Jul 21, 2003
Posts: 522
Perhaps like this :roll:

- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
I agree. Here's the link:
subject: comparing chars
It's not a secret anymore!