This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Java in General and the fly likes Inheritance error? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Inheritance error?" Watch "Inheritance error?" New topic

Inheritance error?

Kevin Tansey
Ranch Hand

Joined: Dec 11, 2005
Posts: 44
I'm trying to call a method to get a value...

but I'm not sure exactly how to do it!

This is a small part of a large project, I'm just plugging away at trying to do each portion one at a time.

I have several files, and here's how they stand right now, I will describe where my problem is right now at the end: (I'm done with this one, yay (dont think I need to touch this one at all) (this is the fun one...)

The problem I'm working on right now is the getGPA() method of - where I am supposed to get the sum by multiplying the course quality points by the number of credits.

I have:

And the error I am getting on this is:
"Cannot make a static reference to the non-static method getQualityPoints() from the type Course"

Does this mean I need to make a call to Course.getQualityPoints() and assign that to a new variable?
[ December 11, 2005: Message edited by: Kevin Tansey ]

BSIT student @ CSUCI
Kevin Tansey
Ranch Hand

Joined: Dec 11, 2005
Posts: 44
I just tried that and it gives the same error about static reference...

Kevin Tansey
Ranch Hand

Joined: Dec 11, 2005
Posts: 44
alright, I think I got it...

feel free to delete this post unless you'd like to give me pointers on any of the other stages I need to complete
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Inheritance error?
It's not a secret anymore!