想在Android中的shell下运行Java程序,为什么在创建线程的时候退出了呢?代码如下,输出"****** test ******"之后就退出了,不知何故?在Windows下运行正常。
package com.hw.hello;
/**
* Created by admin on 2017/8/15.
*/
public class Hello {
public static void main(String [] args)
{
System.out.println("Hello Android, I'm Java!!!");
test();
}
private static void test() {
System.out.println("****** test ******");
new Thread() {
@Override
public void run() {
System.out.println("****** run ******");
super.run();
for (int i=0; i<10; i++) {
System.out.println("******** " + i + " ********");
}
}
}.start();
}
}

package com.hw.hello;
/**
* Created by admin on 2017/8/15.
*/
public class Hello {
public static void main(String [] args)
{
System.out.println("Hello Android, I'm Java!!!");
test();
}
private static void test() {
System.out.println("****** test ******");
new Thread() {
@Override
public void run() {
System.out.println("****** run ******");
super.run();
for (int i=0; i<10; i++) {
System.out.println("******** " + i + " ********");
}
}
}.start();
}
}
