I'm getting into some territory I have never treaded before....
What I have is an Abstract class "Person" with an abstract class "Employee" that extends "Person" and then three concrete classes within "Employee" named: Agent, Accountant, and WebDesigner.
sudo:
abstract class Person{
abstract class Employee extends Person implements myInterface{
class Agent{}
class Accountant{}
class WebDesigner{}
}
class Client{}
}
What I am trying to do is in my driver class is to create an arraylist of abstract type Employee. something like this:
ArrayList<Person.Employee> employeeList = new ArrayList<Person.Employee>();
employeeList.add(new Person.Employee.agent(myStringArray));
But I get the error "an enclosing instance that contains <my reference> is required"
The abstract class within the abstract class is really throwing me off... is there
A) a better way to do this? or,
B) a fairly easy way to fix this error and add a new object to my arraylist?