分析以下代码: public class Test { public static void main(String args[]) { NClass nc = new NClass(); nc.t = nc.t++; } } class NClass { int t; private NClass() { } }
A.
该程序有一个编译错误,因为NClass类具有私有构造函数。
B.
由于main方法的参数列表错误,因此程序无法编译。
C.
该程序可以编译,但是由于t没有初始值,因此会出现运行时错误。
D.
该程序可以编译并正常运行。
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
皮皮学刷刷变学霸
举一反三
【简答题】Harry is a Canadian. He comes from ________________.
【单选题】Harry Rosen is a retail chain of 15 high-end men’s clothing stores. A privately owned company, Harry Rosen accounts for 40 percent of the Canadian market in high-end menswear. The Harry Rosen stores c...