Java在接口中赋值

public class AssignTest {

    public static Integer value = -1;

    public static void printValue(Integer value) {
        System.out.println("printValue: " + value);
    }

    public static void main(String[] args) {

        printValue(value = 0);
        System.out.println("main value is " + value);
    }
}

输出:

printValue: 0
main value is 0

 

你可能感兴趣的:(Java基础,Java在接口中赋值)