JAVA经典面试题之,如何输出100和200------JAVA入门基础教程

public class Test
{
    public static void main(String[] args)
    {
        Test ar = new Test();
        int a = 10;
        int b = 10;
        ar.method(a,b);
        System.out.println(a);
        System.out.println(b);
    }
    public void method(int a,int b)
    {
        a = a * 10;
        b = b * 20;
        System.out.println(a);
        System.out.println(b);
        System.exit(0);
    }
}

你可能感兴趣的:(JAVA随手写,java,算法,排序算法,数据结构,intellij-idea)