240 發(fā)簡信
IP屬地:湖南
  • 窮人糾結(jié)于窮苟翻,卻總是跳不出這個(gè)圈來

  • public synchronized void set(String name, int age){
    if(!flag){
    try {
    super.wait();
    } catch (Exception e) {
    // TODO: handle exception
    e.printStackTrace();
    }
    }
    this.name = name;
    try {
    Thread.sleep(100);
    } catch (Exception e) {
    // TODO: handle exception
    e.printStackTrace();
    }
    this.age = age;
    flag = false;
    super.notify();

    }

    public synchronized void get(){
    if(flag){
    try {
    super.wait();
    } catch (Exception e) {
    // TODO: handle exception
    }
    }
    try {
    Thread.sleep(100);
    } catch (Exception e) {
    // TODO: handle exception
    e.printStackTrace();
    }
    System.out.println(this.getName()+"<===>"+this.getAge());
    flag = true;
    super.notify();

    }

  • Scanner工具類

    1.使用Scanner工具類來獲得用戶輸入的成績信息,Scanner類位于java.util中嘴瓤,使用時(shí)需要導(dǎo)入此包import java.util.Scanner; 2.創(chuàng)建...

亚洲A日韩AV无卡,小受高潮白浆痉挛av免费观看,成人AV无码久久久久不卡网站,国产AV日韩精品