wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes SuperClasses Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "SuperClasses" Watch "SuperClasses" New topic
Author

SuperClasses

ryan vines
Greenhorn

Joined: Dec 08, 2003
Posts: 8
Hi,
I am having trouble calling a superclass constructer. I am trying to call this code but when trying to call it using this code it give me an error saying
I dont know what to do. Please help asap.
Ryan Vines
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
protected double balance
this is not a constructor ryan, it's a method. Constructors do *not* have a return type.


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
ryan vines
Greenhorn

Joined: Dec 08, 2003
Posts: 8
Oops, sry.. That is supposd to be
Sry
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Originally posted by ryan vines:
Oops, sry.. That is supposd to be
Sry

Still don't understant. This code is *not* a constructor.

This is a constructor, it doesn't have a return type.
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
I'm not sure where your double balance is, BUT
Private instance variables aren't valid and accessible until after all parent-classes' constructors have finished.
So, if you're trying to pass that (undefined) balance to the base class' constructor, that may be what it is whining about. Although, it's all speculation because your code came in pieces in the post.
But maybe that will help you find out what is happening.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: SuperClasses