使用 class定义类别 在Java中使用"cass"尖键词来定义类别 publicstring getAccountNumber()( return account Number publicdouble getBalance()( return balance publicvoid deposit (double money) 定义成员 balance + moneyi publicdouble withdraw(double money) balance - moneyi return moneyi使用class定义类别 • 在Java中使用"class"关键词来定义类别 … publicString getAccountNumber() { return accountNumber; } publicdouble getBalance() { return balance; } publicvoid deposit(double money) { balance += money; } publicdouble withdraw(double money) { balance -= money; return money; } } 定义成员