New jdk 1.7

Binary integer

JDK7 provides binary integer type, as long as you can begin with 0b.int a = 0b0101;

Underscore separators

For particularly long numbers, read it a headache, this time dividing the digital underlined, increase code readability.long a = 2222_2222_2222;

 
package test011;

public class test011 {
    public static void main(String[] args){ int a = 0b0000_0000_0000_0000; int b = 1_2312_3131; System.out.println(a); System.out.println(b); } }

Guess you like

Origin www.cnblogs.com/lanqingzhou/p/11894018.html