其他分享
首页 > 其他分享> > 日常笔记1(仅供个人参考)

日常笔记1(仅供个人参考)

作者:互联网

JAVA(需记)

1、JDK7(8也行)新特性:数字之间可以用下划线分割且不会输出下划线

public class Day01 {
   public static void main(String[]args){
       int a = 10_0000_0000;
       System.out.println(a);
   }
}

2、实例变量:从属于对象

数据类型 默认值
byte 0
shout 0
int 0
long 0L
float 0.0f
double 0.0d
char 'u0000'
String null
boolean flase
实例
public class Day01 {
    static byte by;
    static short sh;
    static int i;
    static long l;
    static float f;
    static double d;
    static char ch;
    static String str;
    static boolean bool;

   public static void main(String[]args){
      System.out.println("Byte:"+by);
      System.out.println("Short:"+sh);
      System.out.println("Integer:"+i);
      System.out.println("Long:"+l);
      System.out.println("Float"+f);
      System.out.println("Double:"+d);
      System.out.println("Character:"+ch);
      System.out.println("String:"+str);
      System.out.println("Bool:"+bool);
   }
}
实例输出结果:
Byte: 0
Short: 0
Integer: 0
Long: 0
Float: 0.0
Double: 0.0
Character:
String: null
Bool: false

标签:String,参考,0.0,System,笔记,static,仅供,println,out
来源: https://www.cnblogs.com/jiabaolu/p/14732989.html