1

I have an integer variable

For Ex:

int i=200;//I cant store it as '200'
char c=i;

c should also contain '200' i.e that 200 should be in char format not to the ascii value.

I have tried Character.forDigit(i, 10); and Integer.toString(a).charAt(0);//I can't again parse it

VijayManohar7
  • 123
  • 2
  • 11
  • @Tunaki i know the reason whats the difference between 1 and '1' .I just wanted to suggest the correct syntax to be used.Moreover i tried all the possibilities in that question you suggested and none of it worked – VijayManohar7 Nov 27 '15 at 09:43
  • One must use String for "200" as char may only contain a single character '2'. `String s = String.valueOf(i);`. Three chars in this case. – Joop Eggen Nov 27 '15 at 10:20

0 Answers0