GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes Constructor issues with creating a new checking account object. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Constructor issues with creating a new checking account object." Watch "Constructor issues with creating a new checking account object." New topic
Author

Constructor issues with creating a new checking account object.

Johnathan Beck
Greenhorn

Joined: Apr 16, 2011
Posts: 7
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
Sheriff

Joined: Sep 28, 2004
Posts: 18874
    
  40

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?


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Johnathan Beck
Greenhorn

Joined: Apr 16, 2011
Posts: 7
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.
 
GeeCON Prague 2014
 
subject: Constructor issues with creating a new checking account object.