Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Array

Status
Not open for further replies.

caballeros

IS-IT--Management
Dec 12, 2000
5
US
Hi,
I have created an Object Array, In one of the classes I have created a method to delete a certain entry in the method the value is passed from the main class.

database.removeScore("s2"); and the content is database.studentscores[1] = new StudentScore("s2", 97);

now in the method I have:

void removeScore(String StudentName) {
for (int i = 0;i < studentscores.length; i++)
{
if (StudentName == studentscores.getStudentName())
{
System.out.println(&quot;same&quot;);
}//end if

I'm passing to the method the object &quot;s2&quot; from the main class and it's able to find it. the getStudentName() is an acessor method that returns the StudentName from the StudentScore class.What I want to be able to do is change the value &quot;s2&quot; to null. How can this be done?

Thanks in advanced.
 
You might want to take a look at the java.util.Vector class for this purpose. It seems ideal for what you're trying to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top