aspose file tools
The moose likes Beginning Java and the fly likes Converting an Object to a Character? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Converting an Object to a Character?" Watch "Converting an Object to a Character?" New topic
Author

Converting an Object to a Character?

Brandi Love
Ranch Hand

Joined: Sep 19, 2003
Posts: 133
is there a way to convert something of type Object to a Character?
[ April 01, 2004: Message edited by: Brandi Love ]
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
All Objects have a toString() method which will give a String of characters represnting the object in printable form.
An Object of type Character can be turned into a char primitive with its charValue() method:
char c = myCharacter.charValue();


Mike Gershman
SCJP 1.4, SCWCD in process
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Converting an Object to a Character?
 
Similar Threads
Question about charAt() from JQ+
WA #1.....word association
Wrapping chars in array
split method in java
char to string conversion