This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Constructor issues with creating a new checking account object.

 
Johnathan Beck
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

Cannot find symbol - constructor Checking (java.lang.String,double,int)

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.

Bank class:


Account Class:


Checking Class:
 
Henry Wong
author
Marshal
Pie
Posts: 21003
77
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Johnathan Beck
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic