看板 java 關於我們 聯絡資訊
請問各位 我想要在run()裡面 使用到在main裡面已經處理過的int[] A陣列 main裡面有迴圈是處理封包,有些資訊會存在A[] 裡面 由於封包一直進來,我希望用Thread跑回圈 定時檢查!! 請問該怎麼做到呢?? public class Test extends Thread{ public void run(){ while(true){ //do someting about A } } public static void main(String[] args){ int[] A = new int[10]; // .... // .... new Test().run(); } } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.110.61.14