lptwms/conf/hhwms/MyTest.java

34 lines
606 B
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package hhwms;
import java.util.Date;
public class MyTest {
public static void main(String[] args) throws Exception {
String result = method();
}
public static String method(){
method2();
System.out.println("main方法调用method得到了结果"+new Date().toLocaleString());
return "SUCCESS";
}
private static void method2() {
System.out.println("新线程执行method2已经有10s了"+new Date().toLocaleString());
}
}