SCJP: Which two allow the class Thing to be instantiated using new Thing()? (Choose two.)
A. public class Thing { }
B. class Thing { public Thing(){ } }
C. public class Thing{ public Thing(void){ } }
D. public class Thing{ public Thing(String s){ } }
E. public class Thing{ public void Thing(){ } public Thing(String s){ } }
查看答案
用 修饰的类叫抽象类。抽象类只能被继承,不能被实例化。用 修饰的类叫最终类,只能被实例化,不能被继承。
Java的基础类库在包中,是Java默认引入的包。