caballeros
IS-IT--Management
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("same"
}//end if
I'm passing to the method the object "s2" 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 "s2" to null. How can this be done?
Thanks in advanced.
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("same"
}//end if
I'm passing to the method the object "s2" 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 "s2" to null. How can this be done?
Thanks in advanced.