Skip to Main Content

Why print char 0 (zero) plus String does not work?

2924114Apr 3 2015 — edited Apr 3 2015

Hi guys,

I have a simple doubt. I was studying and create some code to check the result and I found out a strange situation.

Whats wrong with this code? Why it does not print anything?

char = 0; //integer value

System.out.println( c +" String ");

and why this next works very well?

char = 1; //integer value

System.out.println( c +" String ");

I know that char is stored as a positive integer and assign with 0 is different of assign with '0'.

Thanks for any help.

Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on May 1 2015
Added on Apr 3 2015
1 comment