07 2013 档案

 
关于线程间的通信的几个解决事例
摘要:public class MySynchronizedTest implements Runnable {//线程加锁时应是同一对象 int i=100; Object object=new Object(); boolean flag=true; //对方法加锁 public synchronized void count1() { while(flag){ try {//睡眠200ms Thread.sleep(200); } catch (InterruptedException e) { // TODO Auto-generated catch block ... 阅读全文
posted @ 2013-07-28 23:12 孟子hehe 阅读(173) 评论(0) 推荐(0) 编辑
一个简单的邮件发送
摘要:import java.util.Properties;import javax.mail.Authenticator;import javax.mail.Message;import javax.mail.MessagingException;import javax.mail.PasswordAuthentication;import javax.mail.Session;import javax.mail.Transport;import javax.mail.internet.AddressException;import javax.mail.internet.InternetAdd 阅读全文
posted @ 2013-07-17 21:15 孟子hehe 阅读(205) 评论(0) 推荐(0) 编辑

 

点击右上角即可分享
微信分享提示