I am using JAVA for coding. My Aim is to put Location of array into that position of array and it has to be a char array My current Code:-
char arr[]=new char [16];
for(int i=0;i<16;i++)
{
arr[i]=i+1+'0';
}
or
char arr[]=new char [16];
for(int i=0;i<16;i++)
{
arr[i]=i+1;
}
Is not working for java and am getting error "Cannot convert int to char". I have tried finding out about it but i only received solution for c++ and that code dosent work in Java giving the same error.