这个看不懂 能否帮我注解一下
// Level 3 labpackage bank;
public class Teller {
Account myAccount;
public static void main (String args[]) {
Teller me = new Teller();
me.menu();
}
public Teller() {
try {
int count;
byte inData[] = new byte[40];
String inName;
Double inMoney;
System.out.print("Enter account name: ");
count = System.in.read(inData);
if (count == -1) {
System.err.println("Error reading account name");
System.exit(1);
}
inName = new String(inData,0,count-1);
System.out.print("Enter amount to open account: ");
count = System.in.read(inData);
if (count == -1) {
System.err.println("Error reading amount");
System.exit(1);
}
inMoney = Double.valueOf(new String(inData,0,count-1));
myAccount = new Account(inName,inMoney.doubleValue());
} catch (Exception e) {
System.err.println("Exception thrown:"+e.toString());
System.exit(1);
}
}
public void menu() {
try {
int key;
byte inData[] = new byte[40];
Double money;
while(true) {
System.out.print("(B)alance (D)eposit (W)ithdraw (Q)uit: ");
key = System.in.read(inData);
if (key == -1 ||
(char)inData[0] == 'q' || (char)inData[0] == 'Q') {
myAccount.print();
System.exit(0);
}
if ((char)inData[0] == 'b' || (char)inData[0] == 'B') {
myAccount.print();
}
if ((char)inData[0] == 'd' || (char)inData[0] == 'D') {
System.out.print("Enter amount of deposit: ");
key = System.in.read(inData);
if (key != -1) {
money = Double.valueOf(new String(inData,0,key-1));
if (myAccount.deposit(money.doubleValue()) == 0) {
System.out.println("Deposit has been made");
} else {
System.out.println("Problem with Deposit");
}
}
}
if ((char)inData[0] == 'w' || (char)inData[0] == 'W') {
System.out.print("Enter amount of withdraw: ");
key = System.in.read(inData);
if (key != -1) {
money = Double.valueOf(new String(inData,0,key-1));
if (myAccount.withdraw(money.doubleValue()) == 0) {
System.out.println("Withdraw has been made");
} else {
System.out.println("Problem with Withdraw");
}
}
}
}
} catch (Exception e) {
System.err.println("Exception thrown");
System.exit(1);
}
}
}