Hi.
I cannot explain my question very well.
I have an array of objects. Can i perform a search in this?
Check the following code as example:
public class test1 {
public static void main (String[] args){
test2[] array = new test2[2];
for(int i=0;i<2;i++){
array[i]=new test2();
}
int a=1, b=2;
String c ="c", d = "d";
array[0].insert(a, c);
array[1].insert(b, d);
}
}
and
public class test2 {
int z;
String y;
public void insert(int z, String y) {
this.z = z;
this.y = y;
}
}
I want check if int 1 (or String b) exists in array[i].
Is it possible?