{"id":157264,"date":"2019-09-02T10:09:13","date_gmt":"2019-09-02T02:09:13","guid":{"rendered":"https:\/\/gulass.cn\/?p=157264"},"modified":"2019-08-27T10:10:14","modified_gmt":"2019-08-27T02:10:14","slug":"java-async","status":"publish","type":"post","link":"https:\/\/gulass.cn\/java-async.html","title":{"rendered":"\u6559\u4f60\u5982\u4f55\u7528 Java \u5b9e\u73b0\u5f02\u6b65\u8c03\u7528"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u672c\u6559\u7a0b\u6559\u4f60\u5982\u4f55\u4f7f\u7528Java\u5b9e\u73b0\u5f02\u6b65\u8c03\u7528\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u4e00\u3001\u521b\u5efa\u7ebf\u7a0b<\/strong><\/div>\n @Test\r\npublic void test0() throws Exception {\r\n\u00a0 System.out.println(\"main\u51fd\u6570\u5f00\u59cb\u6267\u884c\");\r\n\u00a0 Thread thread=new Thread(new Runnable() {\r\n\u00a0 \u00a0 @Override\r\n\u00a0 \u00a0 public void run() {\r\n\u00a0 \u00a0 \u00a0 System.out.println(\"===task start===\");\r\n\u00a0 \u00a0 \u00a0 try {\r\n\u00a0 \u00a0 \u00a0 \u00a0 Thread.sleep(5000);\r\n\u00a0 \u00a0 \u00a0 } catch (InterruptedException e) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 e.printStackTrace();\r\n\u00a0 \u00a0 \u00a0 }\r\n\u00a0 \u00a0 \u00a0 System.out.println(\"===task finish===\");\r\n\u00a0 \u00a0 }\r\n\u00a0 });\r\n\r\n\u00a0 thread.start();\r\n\u00a0 System.out.println(\"main\u51fd\u6570\u6267\u884c\u7ed3\u675f\");\r\n\r\n}<\/pre>\n |