Java serialization 10- Data Type Range & escape character

A Data Type Range

Second, the eight kinds of data type defaults in the member variables

(1) member variables, no assignment, the compiler does not complain, the system will automatically assign to

byte \ int \ short \ long default value is 0; float \ double default value is 0.0; boolean default is false; char default value \ u0000

Summary: All in line to zero

(2) local variable, not directly assigned if the compiler will complain

 

public  class D10 

{ 

  static  int I = 100 ; 

  static  int a; // this is the member variables, no assignment, the compiler is not given, the system will automatically assign to a 

  public  static  void main (String [] args) 

  { 

    // int B ;   // this is a local variable, if there is no assignment error will be compiled directly 

    // System.out.println (B); 

    System.out.println (I); 

    System.out.println (A); 

  } 

}

 

Third, escapes

After 1.print represents the output does not wrap, and then println represents the output line feed

2. escape character, the backslash is an escape role in java

\ N represent the newline; \ T represents a tab character;

 

public  class d10_2_transferred_meaning_character 

{ 

  public  static  void main (String [] args) 

  { 

    char C1 = 'A' ; 

    System.out.println (C1); 

    of System.out.print (C1); // after the print line represents the output does not change, and println output representative of line breaks after 

    char C2 = '\ n'; // escape character, \ n represents the newline backslash is the escape role in java 

    System.out.println (C2); 

    char C3 = '\ T' ; 

    of System.out.print (C3); 

  } 

}

 

Fourth, the source code:

d10_data_type_default_value.java

d10_2_transferred_meaning_character.jav

https://github.com/ruigege66/Java

2.CSDN: https: //blog.csdn.net/weixin_44630050 (Xi Jun Jun Moods do not know - Rui)

3. Park blog: https: //www.cnblogs.com/ruigege0000/

4. Welcomes the focus on micro-channel public number: Fourier transform, backstage reply "gifts" to get big data learning materials

 

Guess you like

Origin www.cnblogs.com/ruigege0000/p/11280048.html