这就是我想要实现的目标
public class UDPThread extends Thread {
int port;
Spb_server station = null;
public UDPThread(int port, Spb_server station) {
this.port = port;
this.station = station;
}
public static void main(String[] args) {
new UDPThread(5002,station).start();
}
}
station是我正在创建的类的对象Spb_server,我想在main方法中访问它。但它随后要求我制作static我不想做的修饰符。有什么办法可以做到这一点?