• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Constructor problem?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I run this banking program, I get an error (it compiles ok):

Well, there is such a method. Customer.example1() returns a static instance of the Customer class. It compiled just fine before I changed some other methods, having to do with withdrawals and overdrafts. These withdrawals, etc, are in the TestBanking driver program, but come later in the code. Here's the two code sections, Customer first:

and

Like I said, they worked fine before I changed unrelated methods that come later in the code. What gives? Thanks.
[ April 22, 2002: Message edited by: Greg Adams ]
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
A general hint.
Look at the linenumber in the errormessage from the compiler. Here: which line has number 98?
From the message it seems there is a problem with a method that does not exist. Do the methods called from example1() (Customer(String), Savings.example1(), Checking.example1()) exist with the number of parameters you call them with? Are the example1() methods in Saving and Checking static?
hth
tormod
 
Sal Velinus
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, they all exist, and all ran fine till I changed other methods that come later in code. Line 98 is bob.accts[0] = ....., which as I say, ran fine before. There's about 4 or 5 files altogether, which is why I don't post them all.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic