Thread: compile error
View Single Post
  #6 (permalink)  
Old 12-12-2007, 07:51 PM
ShoeNinja's Avatar
ShoeNinja ShoeNinja is offline
Senior Member
 
Join Date: Oct 2007
Posts: 123
ShoeNinja is on a distinguished road
Send a message via AIM to ShoeNinja
Code:
Account Account = new Account(email, password);
So this is the call that you are trying to make. Since you are passing two Strings, the compiler is looking for a constructor that accepts two strings. The one that you have:

Code:
public Account(String email, String pwd, int balance, ArrayList transactions) { this.email = email; password = pwd; balance = 0; transactions = new ArrayList<String>(); }
accepts more arguments than the two Strings that the compiler is looking for so it doesn't think that the method exists (and it doesn't).

It actually would function the same as the one you already have. Look at your code again. You pass in the int balance and the ArrayList transactions but you don't actually do anything with them. You hardcode the account balance to 0 and create a new ArrayList instead of using the one that you passed.

So just copy that code and get rid of the int and ArrayList that you are passing in.
Reply With Quote