多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

我们定义一个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
答案解析:
进入题库查看解析

微信扫一扫手机做题