public class account { private double balance; private String name; public account(String n, int initbal) {balance=initbal; name=n;} public void inquiry() { System.out.println(name+" has balance "+balance); } public void deposit(double amt) { if (amt>0) balance+=amt; } public void withdraw(double amt) { if (amt>0 && amt<=balance) balance-=amt; } public boolean moremoney(account other) { return balance > other.balance; } // private access valid within class public static void main(String[] av) { account myaccount = new account("me", 1000); account youraccount = new account("you", 1000); myaccount.withdraw(100); youraccount.deposit(200); youraccount.inquiry(); System.out.println(youraccount.moremoney(myaccount)); } }//account