Account - /* / Account.java / / A bank account class with...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************* // Account.java // // A bank account class with methods to deposit, withdraw, // and check the balance. //******************************************************* public class Account { private double balance; private String name; private long acctNum; //---------------------------------------------- //Constructor -- initializes balance, owner, and account number //---------------------------------------------- public Account(double initBal, String owner, long number) { balance = initBal; name = owner; acctNum = number; } //---------------------------------------------- //Constructor -- initializes balance and owner; generates random //account number //---------------------------------------------- public Account(double initBal, String owner) { balance = initBal; name = owner; acctNum = (int) (Math.random() * Integer.MAX_VALUE); } //---------------------------------------------- //Constructor -- initializes owner as given and balance to 0. //Generates random account number
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Account - /* / Account.java / / A bank account class with...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online