?? defaultvalue4.java
字號:
//c3:DefaultValue4.java
// author:ZhangHongbin
//This program is protected by copyright laws.
//Initialization of objects.
class Primitive
{
boolean t;
}
public class DefaultValue4
{
Primitive k = new Primitive();
int num;
public static void main(String[] args)
{
//part1
DefaultValue4 D=new DefaultValue4();
DefaultValue4 P=new DefaultValue4();
System.out.println("D after creation="+D);
System.out.println("P after creation="+P);
System.out.println("num of D1="+D.num);
System.out.println("num of P1="+P.num);
D.num=2;
System.out.println("num of D2="+D.num);
System.out.println("num of P2="+P.num);
//part2
System.out.println("k after creation="+D.k);
//part3
Primitive d = new Primitive();
System.out.println("d after creation="+d);
//part4
System.out.println("boolean of d1=" +d.t );
System.out.println("boolean of k1=" +D.k.t );
d.t=true;
System.out.println("boolean of d2=" +d.t );
System.out.println("boolean of k2=" +D.k.t );
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -