BankAccount-hints-for-Tut-3-Ques-4 - public String...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon class BankAccount { // the attributes private String accountNo; private String accountName; private double balance; // the methods // the constructor public BankAccount(String noIn, String nameIn) { accountNo = noIn; accountName = nameIn; balance = 0.0; } // methods to read the attributes public String getAccountNo() { return accountNo;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } public String getAccountName() { return accountName; } public double getBalance() { return balance; } // method to deposit public void deposit(double amountIn) { balance += amountIn; } // method to withdraw public void withdraw(double amountOut) { balance -= amountOut; } } 第 1 頁...
View Full Document

This note was uploaded on 08/18/2011 for the course COMP 3868 taught by Professor Keithchan during the Summer '97 term at Hong Kong Polytechnic University.

Ask a homework question - tutors are online