
-----------------------------------
haz1487
Wed Nov 14, 2007 12:16 am

ASCII values
-----------------------------------
Hey I was wondering if there was a way of getting the ASCII value of a character in JAVA. Similar to the ord command in turing.

And if possible can you tell me how to print those values as characters?

-----------------------------------
zylum
Wed Nov 14, 2007 2:04 am

RE:ASCII values
-----------------------------------
cast it to int and print that.

-----------------------------------
HeavenAgain
Wed Nov 14, 2007 12:10 pm

RE:ASCII values
-----------------------------------
you are asking for ord, and yet you are asking "how to print those values as characters"

but cast to int and char will work for both cases :P
System.out.print((int)'a'+" "+(char)95);
casting rule! (sometimes)
