class bankaccount { private String name; // owner of account private static balance; private static double interest = 0.01; public static void changerate(double x) { interest = x; } // balance inquiry: public double inquiry() { return balance; } public void deposit(double amt) { balance += amt; } public void withdraw(double amt) { if (amt<=balance) balance -= amt; } public bankaccount(String n, double b) { name = n; balance = b; } public bankaccount() {} } public class account { public static void main(String args[]) { bankaccount myaccount; myaccount = new bankaccount("me",100); bankaccount youraccount; youraccount = new bankaccount("you",200); myaccount.withdraw(20); youraccount.deposit(30); System.out.println("my balance is " + myaccount.inquiry()); } }