[Solved] Adding a “space” value to a char in Java

[ad_1]

As per my understanding you are trying to assign space value in to char type .But the value you given is a string and trying to assign in to a char type .if u want to assign a space character do it by using ‘ ‘.

char mychar=" "; //wont works because you are assigning  a string type in to char type

but

char mychar=" ";//this will work because assigning a char type in to char type

[ad_2]

solved Adding a “space” value to a char in Java