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

题目详情

单选题 如果有以下关于构造函数的程序片段: public class Some { public int x; public Some(int x) { this.x = x; } } 以下描述正确的是( )

A. 建构Some时,可使用new Some()或new Some(10)形式

B. 建构Some时,只能使用new Some()形式

C. 建构Some时,只能使用newSome(10)形式

D. 没有无自变量建构式,所以编译失败

面向对象程序设计课程封面

学科:面向对象程序设计

时间:2025-11-20 04:39:33

Copyright © 2022 津ICP备2021001502号