Objects and custom classes
Hi everyone, I'd be new to community, and fairly new to Java.
I'm a 2nd Year BSc Computing Science student at University here in London (UK), and I'm stuck with one little problem on a project program I'm writing, and I was wondering if anyone could offer some advice on how I could go about rectifying my problem.
I've had to write a Share managing program, where information on each share is stored in a custom class object called ShareInPortfolio which is then stored into a vector. My problem is that when I try to get an element of the vector so I can alter variables inside ShareInPortfolio (through accessor and mutator methods defined in the class), the JDK is telling me that it is finding a Java.lang.Object where ShareInPortfolio is required.
Any advice on what I might be doing wrong would be much appreciated.
The project's due in tomorrow, and I've got it all but finished... except for this error - but I don't have to submit a working program. I can submit incomplete code as long as I say what it should be doing in the places it doesn't work.
I'm just a perfectionist and would ideally like to submit it working if I can.
I'm a 2nd Year BSc Computing Science student at University here in London (UK), and I'm stuck with one little problem on a project program I'm writing, and I was wondering if anyone could offer some advice on how I could go about rectifying my problem.
I've had to write a Share managing program, where information on each share is stored in a custom class object called ShareInPortfolio which is then stored into a vector. My problem is that when I try to get an element of the vector so I can alter variables inside ShareInPortfolio (through accessor and mutator methods defined in the class), the JDK is telling me that it is finding a Java.lang.Object where ShareInPortfolio is required.
Any advice on what I might be doing wrong would be much appreciated.
The project's due in tomorrow, and I've got it all but finished... except for this error - but I don't have to submit a working program. I can submit incomplete code as long as I say what it should be doing in the places it doesn't work.
I'm just a perfectionist and would ideally like to submit it working if I can.
