I have a class called Storage
test that is doing the following:
//Class to test the operation of the Storage class
public class StorageTest
{
public static void main(String [ ]args)
{
//Defines the number of Student objects
int number = 6;
//Make an instance of Storage class to store Student object references in
Storage store = new Storage (number);
store.storeStudent ("Joe Bloggs", "Java");
store.storeStudent ("Fred Smyth", "Visual Basic");
store.storeStudent ("Sally Collins", "History");
store.storeStudent ("JOHN DOE", "Java");
store.storeStudent ("JOE DOHN", "Visual Basic");
store.storeStudent ("Joe Dohn", "Visual C#");
I then have another class called Storage which has a method called storeStudent:
NOTICE I TOOK AWAY MY FOR LOOP. WHICH RESULTED IN THE FOLLOWING:
C:\java>
java StorageTest
This is what is coming into method: Joe Bloggs Java
Student@11a698a Now stored
This is what is coming into method: Fred Smyth Visual Basic
Student@107077e Now stored
This is what is coming into method: Sally Collins History
Student@7ced01 Now stored
This is what is coming into method: JOHN DOE Java
Student@1ac04e8 Now stored
This is what is coming into method: JOE DOHN Visual Basic
Student@765291 Now stored
This is what is coming into method: Joe Dohn Visual C#
The PROBLEM with this (besides sorting the toSting( ) - another problem). I can't store everything in the position lp which is initialised to 0??