non-static method cannot be referenced from a static context


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: non-static method cannot be referenced from a static context

Threaded View

  1. #1
    Join Date
    Mar 2004
    Posts
    20

    Exclamation non-static method cannot be referenced from a static context

    hi, i've basically been doin my assignement, we have to create a very simple student registeration thing for a college, i've just implemented basic stuff to get the functionality goin, i created my Student Class, which has two sub-classes FullTimeStudent and PartTimeStudent.

    now i'm creating a register class, this class should be able to store "Student" objects in an array, and have methods to access the array and manipulate the contents.

    from this class we have been guided to have ATLEAST the following:

    - add a new student of either FullTimeStudent or PartTimeStudent
    - remove a student with a given student id number...
    - request fees due for a given student...
    and stuff on similar terms to that.

    my problem lies with the first one.

    from what i gathered, the lecturer was hinting at creating a single method from which i can create a student object and make either a FullTime or PartTime student.

    i didn't know exactly how to do this, as i will be implenting a simple interface later, i decided that i will create two seperate methods so i can jut call the appropriate method, one to create a FullTimeStudent and for PartTime (using the appropriate classes constructor. When i tried this, and i tried to test if it worked, i got the static method error thingy in the subject line!

    please find attached my java code files zipped!

    any help and soon will be very well appreaciated!!!
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center