• 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

Inheritance error?

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

Student.java

Course.java

Grade.java (I'm done with this one, yay

Name.java (dont think I need to touch this one at all)

Transcript.java (this is the fun one...)



The problem I'm working on right now is the getGPA() method of Transcript.java - 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 ]
 
Kevin Tansey
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just tried that and it gives the same error about static reference...

 
Kevin Tansey
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic