题海让大学四年没有难题
白天模式登陆

题目详情

多选题 分析以下代码:class Test { private double i; public Test(double i) { this.t(); this.i = i; } public Test() { System.out.println("Default constructor"); this(1); } public void t() { System.out.println("Invoking t"); }}

A. this.t()可以用t()代替

B. this.i可以用i代替

C. 必须在System.out.println("Default constructor")之前调用this(1)

D. this(1) 必须替换为this(1.0)

Java程序设计课程封面

学科:Java程序设计

时间:2025-03-14 05:58:35

Copyright © 2022 津ICP备2021001502号