I want to run the Java program under Android in shell. Why did the program quit when I created the thread? -


i want run java program under android in shell. why did program quit when created thread? sample code follows。

    package com.hw.hello;      /**      * created 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();                     (int i=0; i<10; i++) {                         system.out.println("******** " + + " ********");                     }                 }             }.start();         }     } 

the results follows: enter image description here


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -