Java.io.ObjectStreamClass.getName() 方法


Java.io.ObjectStreamClass.getName() 方法

package com.codingdict;



import java.io.*;

import java.util.Calendar;



public class ObjectStreamClassDemo {



   public static void main(String[] args) {



      // create a new object stream class for Integers

      ObjectStreamClass osc = ObjectStreamClass.lookup(Integer.class);



      // get the name of the class and print it

      System.out.println("" + osc.getName());



      // create a new object stream class for Calendar

      ObjectStreamClass osc2 = ObjectStreamClass.lookup(Calendar.class);



      // get the name of the class and print it

      System.out.println("" + osc2.getName());

   }

}