java编程思想-第六章-某些练习题

参考https://blog.csdn.net/caroline_wendy/article/details/47271037

3

package debug;
import java.util.Arrays;

/**
 * 输出信息
 * Created by wang on 15/8/4.
 */
public class Log {
    public static void v(String[] strs) {
        System.out.println(Arrays.toString(strs));
    }
}

package debugoff;

/**
 * 不输出
 * Created by wang on 15/8/4.
 */
public class Log {
    public static void v(String[] strs) {
        System.out.println("null");
    }
}

import static debug.Log.*;
//import static debugoff.Log.*; // 无输出

/**
 * 测试输出
 * Created by wang on 15/8/4.
 */
public class TestLog {
    public static void main(String[] args) {
        v(args);
    }
}
/**
 * Output:
 * (1) null
 * (2) [My, Name, is, Girl, !]
 */
 
原文地址:https://www.cnblogs.com/lijingran/p/9017160.html