the difference of String.valueOf(char) and +
- by Will Yu
to show the default value of char ,I wrote code like this:
public class TestChar {
static char a;
public static void main(String[] args) {
System.out.println("."+String.valueOf(a)+".");
System.out.println("the default char is "+a);
}
}
but the console output is confused.the first is ". ." ,however the second is "the default char is [](like this ,I don't know how to describe it.)" why?thanks for help