代码拉取完成,页面将自动刷新
同步操作将从 tzhanggit/JavaProgramming 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package ch5.testStatic;
/**
* 1. static variables
* վ̬ʼ˳
*/
class Bowl {
Bowl(int i) { System.out.println("Bowl(" + i + ")"); }
void f1(int i) { System.out.println("f1(" + i + ")"); }
}
class Table {
static Bowl bowl1 = new Bowl(1);
Table() {
System.out.println("Table()");
bowl2.f1(1);
}
void f2(int i) { System.out.println("f2(" + i + ")"); }
static Bowl bowl2 = new Bowl(2);
}
class Cupboard {
Bowl bowl3 = new Bowl(3);
static Bowl bowl4 = new Bowl(4);
Cupboard() {
System.out.println("Cupboard()");
bowl4.f1(2);
}
void f3(int i) { System.out.println("f3(" + i + ")"); }
static Bowl bowl5 = new Bowl(5);
}
public class StaticInitialization {
public static void print(int x, int y) {
}
public static void main(String[] args) {
System.out.println("new Cupboard() in main");
new Cupboard();
System.out.println("new Cupboard() in main");
new Cupboard();
table.f2(1);
cupboard.f3(1);
StaticInitialization.print(1, 2);
Math.abs(-5);
}
static Table table = new Table();
static Cupboard cupboard = new Cupboard();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。