Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

convert from number (0-255) to character

  Asked By: Craig    Date: Apr 12    Category: Java    Views: 4378

I would like to ask for some help, I want to convert
from number (0-255) to character, and what I do is:

for (int i =0;i<255;i++) {System.out.println

Some number appears as "?" and some number is appears
not correctly.



2 Answers Found

Answer #1    Answered By: Betty White     Answered On: Apr 12

what you want to do is just to change/convert integers to character  and i
run that line too it is just printing character who's ascii is that like in
0-255 there may be sapce, or some special character so check it with an ascii

Answer #2    Answered By: Muhammad Abdullah     Answered On: May 02

//I had Answer for You But it is in C++.May be this help you and you wil change it //into Java
using namespace std;

int main()
	char complete_character[255],a ='!';
	for(int i=0;i<255;i++)
		complete_character[i] = a+i;
	for(int i=0;i<255;i++)

Didn't find what you were looking for? Find more on convert from number (0-255) to character Or get search suggestion and latest updates.