This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi guys. I figured I would come here to get some help on some Java stuff. I am new to Java and taking it as part of my computer science major. I have been pretty good at it and I have learned a lot of things when it comes to Java. However I have hit a brick wall when it comes to a lab I am doing. Please be aware that these are academic exercises and I am not really looking for handouts since I do need to learn this. All I am asking for is some hints, suggestions, and some direction to the solution to the problem.
With that said here is where I am at.
I am working on a simulation of a bank with a series of checking and saving account objects to be stored in a database. I have created an ArrayList of type Account named accounts. However I am having a problem with adding a checking account object (and to a certain extent a savings account object. But once I figure this out adding a savings account object to the arraylist will be cake.) to my accounts ArrayList. At compile I am getting the following error:
I know I am on the right path but I can't seem to get past that whole constructor issue that the newChecking object is having. So that is where I am at a loss. Any thoughts and suggestions would be helpful and gratefully accepted.
Here's the code for the Bank class, Account class, and Checking class since they are related. If you want to look at the checking and savings classes let me know and I will post the code.
Johnathan Beck wrote:
Cannot find symbol - constructor Checking (java.lang.String,double,int)
Hint: Take a look at the parameters (specifically, the types) to your Checking class constructor. Do they match in how you are using it?
Well after your hint I looked at the checking class constructor and found out they did not match in how I was using it. Thank you so much for your hint. Without it I probably would of been looking at it for hours. Sometimes it takes another set of eyes to see what is going on.
I will remember to keep that in mind in the future. Thank you again for your help.