• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic