ArrayList not recognizing subclass variables
<p>I am having a problem with seeing subclass attributes in an ArrayList.</p>

<p>Here's some snippets of the main parts of my code that matter here.</p>

<pre><code>private ArrayList&lt;Person&gt; people = new ArrayList&lt;Person&gt;;

abstract class Person {
String fName;
String lName;
}

public class Employee extends Person {
protected int empID;
}

public class Client extends Person {
protected int clientID;
}
</code></pre>

<p>When using a for loop to search by clientID, I am getting </p>

<p>Enterprise.java:134: cannot find symbol
symbol  : variable clientID
location: class Person</p>

<p>I have tried with and without instanceof Client on the for loop. I have also tried using Client instead of Person in the for loop parameters.</p>

<pre><code>for(Person x : people) {
if(x.clientID == cid) {
    System.out.println(x);
}
</code></pre>

<p>Before turning these into subclasses I had them in an ArrayList of their own kind and everything worked flawlessly.</p>

<p>Any help would be greatly appreciated!</p>
