黑马程序员技术交流社区

标题: 5.21 [打印本页]

作者: 李显亮    时间: 2018-5-21 07:28
标题: 5.21
package i.love;

public class Love520 {
        private static int live = 27;

        public static void main(String[] args) {
                boolean alive = true;
                while (alive) {
                        try {
                                Object theGirl = Class.forName("i.love.You").newInstance();
                                live++;
                                theGirl.wait();
                        } catch (Exception e) {
                                System.out.println("waiting for myGirl to begin at:" + live);
                        }
                }
        }
}

作者: 逆风TO    时间: 2018-5-28 10:53
赞赞赞
作者: 李显亮    时间: 2018-5-29 11:57
逆风TO 发表于 2018-5-28 10:53
赞赞赞

谢谢





欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2