优化这段代码: new Threadnew Runnable Override public void run try Systemoutprintln接收到的信息:+ json; Systemoutprintlnh
优化后的代码: new Thread(() -> { try { System.out.println("接收到的信息:" + json); if (json.contains("name") && json.contains("type")) { Outwgreciveinformation(json); } LinkedHashMap<String, Object> hashMaps = stringToJsonObject(json); i++; System.out.println("接收数据第" + i + "次"); Thread.sleep(10); } catch (Exception e) { e.printStackTrace(); } }).start();
原文地址: https://www.cveoy.top/t/topic/bIbc 著作权归作者所有。请勿转载和采集!