It sounds like you're running into problems because you're not using
good OO design. Instead of using a two dimensional array, you should
use an array of House objects:
public class House {
private int numberBeds;
private int numberBaths;
public House(int numberBeds, int numberBaths) {
this.numberBeds = numberBeds;
this.numberBaths = numberBaths;
}
public int getNumberBeds() { return numberBeds; }
public int getNumberBaths() { return numberBaths; }
}
Then, you wouldn't have to worry about the second dimension of your
array being defined or not:
//Assume houseArray is of type House
if ( houseArray[i].getNumberBeds == beds &&
houseArray[i].getNumberBaths == baths ) {
//Do stuff here.
}
Hope this helps.
//Nathan
ho***********@hotmail.com (Bryce Maschino) wrote in message news:<3b*************************@posting.google.c om>...
hello,
i'm working on a project searching through a list of arrays based on
user input. the problem is that if a user does not define a certain
variable, my if statement will not evaluate. i need a way to tell the
if statement to skip over a certain evaluation if the value is null.
if ((House[i][1] == beds) && (House[i][2] == baths)) {
statments
}
if someone doesn't define # of beds, how do i skip that evaluation?
thanks!
bryce