public class BankAccount
{
	private String accountNumber;    //instance fields
	private double balance;
	public BankAccount( )                //constructor  -- a method that executes when an object
		{			// is created.  It has the same name as the class.
			accountNumber = "A";
			balance = 0;
		}
public BankAccount( String a, double b)    //constructor with parameters  -- a method 
                    {                                                     //that executes when an object is created.
			accountNumber = a;      //parameters give value to instance fields
			balance = b;
		}
	public double getBalance( )          //accessors - methods that return value of the
                        {			      // instance fields.  Supports the concept of
			return balance;      // data hiding.  Convention: begin with get.
                         }
	public String getAccountNumber( )
                        {			      
			return accountNumber;
                         }
	public void setBalance( double b ) //mutators - methods that set value of the
                        {                                          // instance fields.  Supports the concept of
			balance = b;             // data hiding.  Convention: begin with set.
                         }
             public void setAccountNumber(String a)
		{
			accountNumber = a;
		}
	public void deposit(double b)         //Member methods - do the business of 
 		{			       //a BankAccount
                                    balance += b;
                         }
            public void withdraw (double w)
                         {
			balance -=  w;
                          }
	public String toString( )          //toString inherits from the Object class
                         {			//All Java programs inherit from Object
			return "Account Number -> " + accountNumber + "\n" +
				"Balance              ->"  + balance;
		}
}

