1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| import java.io.Serializable; public class IsAssignableFromTest implements Serializable{ private static final long serialVersionUID = 5716955136475665579L; public static void main(String[] args) { boolean re1= Object.class.isAssignableFrom(IsAssignableFromTest.class); boolean re2=Serializable.class.isAssignableFrom(IsAssignableFromTest.class); System.out.println("re1:"+re1+" re2:"+re2); } }
|