An enclosing instance that contains <my reference> is required
问题 An enclosing instance that contains is required Below is the code. positionObj is the object that I am trying to use and it is giving me the above error. It\'s unclear why. package toolBox; import toolBox.Secretary.positionObj; public class PositionManagement { public static HashMap<String, Secretary.positionObj> main(String vArg){ positionObj newPosition=new positionObj(); } } 回答1: You're trying to use the non-static inner positionObj class without an instance of Secretary for it to belong