J04_初始化与清除.pptVIP

  • 4
  • 0
  • 约1.09万字
  • 约 33页
  • 2016-11-28 发布于河南
  • 举报
* * 可变参数列表 class A {}; public class NewVarArgs { static void printArray (Object... args) { for (Object obj: args) System.out.print(obj + ); System.out.println(); } public static void main(String[] args) { printArray(new Integer(47), new Float(3.14), new Double(11.11)); printArray(47, 3.14F, 11.11); printArray(one, two, three); printArray(new A(), new A(), new A()); printArray((Object[])new Integer[]{1,2,3,4}); printArray();//Empty list is OK } } 47 3.14 11.11 47 3.14 11.11 one two three A@de6ced A@c17164 A@1fb8ee3 1 2 3 4 * * 枚举类型 enum 从Java SE5起 public enum Spici

文档评论(0)

1亿VIP精品文档

相关文档