test/jdk/java/io/Serializable/enum/classObject/Test.java
changeset 58565 baa5969ecf34
parent 47216 71c04702a3d5
equal deleted inserted replaced
58564:218a1a642c6f 58565:baa5969ecf34
     1 /*
     1 /*
     2  * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    33 
    33 
    34 public class Test {
    34 public class Test {
    35     public static void main(String[] args) throws Exception {
    35     public static void main(String[] args) throws Exception {
    36         ByteArrayOutputStream bout = new ByteArrayOutputStream();
    36         ByteArrayOutputStream bout = new ByteArrayOutputStream();
    37         ObjectOutputStream oout = new ObjectOutputStream(bout);
    37         ObjectOutputStream oout = new ObjectOutputStream(bout);
    38         Class[] classes = { Enum.class, Foo.foo.getClass(),
    38         Class<?>[] classes = { Enum.class, Foo.foo.getClass(),
    39                             Foo.bar.getClass(), Foo.baz.getClass() };
    39                             Foo.bar.getClass(), Foo.baz.getClass() };
    40         for (int i = 0; i < classes.length; i++) {
    40         for (int i = 0; i < classes.length; i++) {
    41             oout.writeObject(classes[i]);
    41             oout.writeObject(classes[i]);
    42         }
    42         }
    43         oout.close();
    43         oout.close();