- 单项选择题我们定义一个Account类来描述银行账户,银行账户有账户名、金额等属性特征,同时有存款、取款等行为特征,下述代码适合描述的是哪项?()
A、class Accountf String name;//账户 S tring amount; //金额 Account (String name)( ) void deposit (double mount){ //存款 ) void withdraw (double mount){ //取款 } )
B、class Accountf String name;//账户d ouole amount; //金额 Account(double amount){ } void deposit (double mount){ //存款 ) void withdraw (double mount){ //取款 ) )
C、class Accountf String name;//账户 double amount; //金额 Account (String name){} void deposit (double mount){//存款 ) void withdraw (double mount){ //取款 ) )
D、class Accountf String name;//账户 double amount;//金额 Account (String name){} void deposit(){//存款 ) void withdraw(){//取款 ) )
- C
关注下方微信公众号,在线模考后查看