JAVA 例子

上一篇 / 下一篇  2010-12-03 15:22:45 / 个人分类:JAVA

package junittest;
import java.util.*;
import junit.framework.*;

class test1 {
    public static void main(String args[]) {
        testsimple b = new testsimple();
        double result;
        // call all versions of test()
        ob.test();
        ob.test(10);
        ob.test(10, 20);
        result = ob.test(123.40);
    }
}
class testsimple {
    void test() {
        System.out.println("No parameters");
    }

    void test(int a) {
        System.out.println("a:" + a);
    }

    void test(int a, int b) {
        System.out.println("a and b:" + a + " " + b);
    }

    double test(double a) {
        System.out.println("double a: " + a);
        return a;
    }
}


TAG:

 

评分:0

我来说两句

Open Toolbar