封装
System.out.println
public class OverloadTest04{ public static void main(String[] args){ U.p(10); U.p("abc"); U.p(true); U.p(1.0); } } /* class U{//用方法重载封装了输出语句 public static void p(byte b){ System.out.println(b); } public static void p(short b){ System.out.println(b); } public static void p(int b){ System.out.println(b); } public static void p(long b){ System.out.println(b); } public static void p(float b){ System.out.println(b); } public static void p(double b){ System.out.println(b); } public static void p(boolean b){ System.out.println(b); } public static void p(char b){ System.out.println(b); } public static void p(String b){ System.out.println(b); } } */