Java基础——类成员变量不初始化默认值

package com.yonyou.review.base;

public class ClassMember {
	static int i;
	static char c;
	static String s;
	static float f;
	static double d;
	static byte b;
	static short sh;
	static long l;
	static boolean bl;
	public static void main(String[] args) {
		System.out.println("i="+i);
		System.out.println("c="+c);
		System.out.println("s="+s);
		System.out.println("f="+f);
		System.out.println("d="+d);
		System.out.println("b="+b);
		System.out.println("sh="+sh);
		System.out.println("l="+l);
		System.out.println("bl="+bl);
	}

}

 

输出结果:

 

i=0
c=
s=null
f=0.0
d=0.0
b=0
sh=0
l=0
bl=false

 

 

 

 

 

你可能感兴趣的:(Java系列——Java基础)