Question: protected String name; protected ArrayList stocks; protected double balance; + Account ( String name, double balance) //stocks = new ArrayList () ; + get and
protected String name; protected ArrayList
@Override public String toString(){ StringBuffer str = new StringBuffer("Stocks: "); for (Stock s : stocks){ str.append(s.toString() + " "); } return "Name: " + name + ", balance: " + balance +"\t" + str.toString(); }
can anyone convert this to java?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
