If you scare up an ASCII Chart you can see that 11 or 0x0B is a vertical tab character. On some devices I'd guess this tabs down or advances paper in a printer or something. Since it's in a range that is not printable, you get the little square symbol. I think you'd be safe saying 32-126 are printable. I used to use the "extended" set 127 and up on DOS.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: Sep 01, 2004
Alright i see, but is there a way to reverse the conversion that getNumericValue() does?
Well, you can't. Both 'B' and 'b' are converted to 11 by the getNumericValue() method, just for one example. There are about 10 different Unicode characters that are converted to 1 -- you can find out what they are by writing a simple test program.
In my experience answering these questions, usually people who are using getNumericValue() don't understand what it does, and it usually isn't the right solution to their problem. What was your original question, anyway? I mean the one that you thought getNumericValue() was the answer to?
The first line isn't valid and won't compile. The second line would have been better served by a simple call to Integer.toString(somenumber) and would avoid creating a StringBuffer/Builder unnecessarily. Your professor needs to take a class.
Joined: Jun 05, 2006
lol sorry meant to put "" yes he prob does lol
Joined: Jul 15, 2003
That wouldn't compile either. "" + int will return a String which cannot be converted to char.
So back to the original question. Make sure you understanad what Character.getNumericalValue() actually does. I agree with Paul that this method is probably not the solution to your original task. So let's back up a little bit. Can you describe what this code is supposed to do? That is what is the original problem or the context where you decided you might need to use this method? If there is a better solution, I'm sure we can help you find it from there.