java现在都忘的差不多了
线程的想不起来了。
自己看一下书,很简单的。

解决方案 »

  1.   

    public class B{
    public static void main(String args[]) {
    System.out.println(compareTwoDigit("welcome","to"));
    Thread a = new Thread(new A());
    a.start();

    }
    public static int compareTwoDigit(String a,String b){
    return a.length() >= b.length()?a.length():b.length();

    }
    public void output(){
    System.out.println("output()");
    }
    }
    class A extends B implements Runnable {
    A() {
    Thread thread = new Thread();
    }
    public void run() {
    while(true) {
    this.output();
    try {
    Thread.sleep(3000);
    }catch (Exception e){
    }
    }
    }
    }
      

  2.   

    你这样还找工作啊?先把java给学习好了再说吧
      

  3.   

    A() {
    Thread thread = new Thread();
    }
    ===================================================
    这里应该是 
    A() {
    Thread thread = new Thread(this);
    }
    吧====================================
    ====================================
    而且比较字符串不仅仅是比较字符串的长度的。是按照码值来比较的。而且题目要求返回较大字符串的大写。public String compareTwoDigit(String a,String b){
    return a.compareTo(b) >= 0 ? a.toUpperCase() : b.toUpperCase();

    }