dcsimg
How do I get an ASCII character from an Int???
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   paddlepop_Lioness
Posted On:   Tuesday, October 9, 2001 02:16 AM

Probably a dumb question here, but I have an integer and I want to get the corresponding ASCII character (ie if I have 42, I want to get the char '*')

I'm sure there's a method somewhere in the API, but I sure can't find it!

Thanks
PaddlePopLioness

Re: How do I get an ASCII character from an Int???

Posted By:   Manikandan_Ramanthan  
Posted On:   Tuesday, October 9, 2001 04:28 AM

I am not sure that there is any predefined method in java for acquiring your result,but I have sent the coding along with this mail for your ref.so,if you substitute this with yours,the program works fine.




dem.java


--------


class dem{


public static void main(String ar[])

{


int i=42;


char c=(char)i;


System.out.println(c);


}


}
About | Sitemap | Contact