I can't see default value for instance "char" in java

Guna Yuvan :

I have found that instance variable "char" default value is "u0000" (unicode of null). But when I tried with the piece of code in below, I could only see an empty print line. Please give me clarification.

public class Basics {

     char c;
     int x;

     public static void main(String[] args) {
         Basics s = new Basics();

         System.out.println(s.c);
         System.out.println(s.x);
     }   
}

Console output as follow:

(empty line)
0
Andrew Tobilko :

'\u0000' (char c = 0;) is a Unicode control character. You are not supposed to see it.

System.out.println(Character.isISOControl(s.c) ? "<control>" : s.c);

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=77489&siteId=1