Java two get() methods after each other
<p>I am trying to compare two int values with a method. </p>

<p>I have put two get methods after each other because the array[i] is a list of person objects and gethouse only gives the house object, the houseid is in another class. </p>

<p>I'm wondering if I can set up two get() methods after each other?</p>

<pre><code>public Person findperson( int houseId ){

    for ( int i = 0; i &lt; array.length; i++ ){
        if ( array[ i ].gethouse().gethouseID() == houseId  ){
            return array[ i ];
        }
    }
    return null;
}
</code></pre>
