test12.java~

来自「SCJP认证考试资料」· JAVA~ 代码 · 共 34 行

JAVA~
34
字号
import java.io.*;
class B{
    int i = 2;
    B(int i) {
	this.i = i;
    }
}
class Test12 extends B implements Serializable {
    int x = 5;
    Test12(int x) {
	super(5);
	this.x = x;
    }
    public static void main(String[] args) {
	Test12 t = new Test12();
    }
}
/*
class Test12{
    public static void main(String[] args) throws Exception {
	File f = new File("a.txt");
	ObjectOutputStream oos = new ObjectOutputStream(
				      new FileOutputStream(f));
	oos.writeObject(new A(2));
	oos.close();
	ObjectInputStream ois = new ObjectInputStream(
						      new FileInputStream(f));
	A obj = (A)ois.readObject();
	System.out.println(obj.x);
	ois.close();
    }
}
*/	   

⌨️ 快捷键说明

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