The first few days to do a function, is to change the information in the foreground will be automatically emailed to other people, the relevant information has been changed, just at the beginning is directly after the change information code to join the sending message code, but found that this will make the interface particularly slow, and slow the main reason is because the sending of mail sometimes takes a long time, so Send the message after changing the information, but the program continues to run down.
Package Com.xian;public class Test {/** * @param args */public static void main (string[] args) {//TODO auto-generated met Hod stubstring str= "Hello Xian yu"; new Thread () {public void run () {for (int i=0;i<=30;i++) System.out.println ("----" + " Send the message "+"---------");}. Start (); for (int i=0;i<=100;i++) System.out.println ("----" + "Hello Xian yu" +i+ "---------");}}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Simple Java Multi-threading usage