Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.Serializable;
- public class Account implements Serializable {
- private int accountNum;
- private String username;
- private String password;
- private double balance;
- public Account(int accountNum, String username, String password, double balance) {
- this.accountNum = accountNum;
- this.username = username;
- this.password = password;
- this.balance = balance;
- }
- public int getAccountNum() {
- return accountNum;
- }
- public void withdraw(int amount) {
- balance-=amount;
- System.out.printf("Successfully withdrawn %d from account. New balance is %f\n", amount, this.balance);
- }
- public void deposit(int amount) {
- balance+=amount;
- System.out.printf("Successfully deposited %d to account. New balance is %f\n", amount, this.balance);
- }
- public double getBalance() {
- return balance;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement