The problem is that TeamLeader
appears to be an inner class (hard to tell, your indentation is bad), and since it’s not static, you can’t instantiate it by itself.
You either need to make TeamLeader
its own class, or make it a static
class and instantiate it as Employee.TeamLeader
(or whatever the parent class is, your indentation is really not helpful here).