⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 staticinitialization.java.bak

📁 java编程思想的部分实现
💻 BAK
字号:
//:c04; Staticinitialization.java
//Specifying initial values int a class definition.
class Bowl
{
	Bowl(int marker)
	{
		System.out.println("bowl("+marker+")");
	}
	void f(int market)
	{
		System.out.println("f("+market+")");
	}
}
class Table
{
	static Bowl b1=new Bowl(1);
	Table()
	{
		System.out.println("Table()");
		b2.f(1);
	}
	void f2(int market)
	{
		System.out.println("f2("+market+")");
	}
	static Bowl b2=new Bowl(2);
}
class Cupboard
{
	Bowl b3=new Bowl(3);
	static Bowl b4=new Bowl(4);
	Cupboard()
	{
		System.out.println("Cupboard");
		b4.f(2);
	}
	void f3(int market)
	{
		System.out.println("f3("+market+")");
	}
	static Bowl b5=new Bowl(5);
}
public class Staticinitialization
{
	public static void main(String [] args)
	{
		System.out.println("Creating new cupboard!");
		new Cupboard();
		System.out.println("Creating new cupboard!");
		new Cupboard();
		t2.f2(1);
		t3.f3(1);
	}
	static Table t2=new Table();
	static Cupboard t3=new Cupboaed();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -