分析以下代码: public class Test { int x; public Test(String t) { System.out.println("Test"); } public static void main(String[] args) { Test test = new Test(); System.out.println(test.x); } }
A.
该程序有一个编译错误,因为无法从构造函数中调用System.out.println方法。
B.
该程序有一个编译错误,因为x尚未初始化。
C.
该程序有一个编译错误,因为您不能从定义对象的类中创建对象。
D.
该程序有一个编译错误,因为Test没有默认的构造函数。
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【简答题】II . Answer the following questions. 1. What things should be prepared before going to the airport? 2. Please list the procedures of taking an international airplane.