获取主类实例 在主类中加入: public static 主类名 INSTANCE; public 主类名() { INSTANCE = this; } “主类名”:所在主类的名称 在其它类中获取主类实例时只需要在前面加上: 主类名.INSTANCE. 即可。