Содержание
- 2. Using Java Reflection API interface , you can do the following: Determine the object class .
- 3. Getting the object class type MyClass a = new MyClass(); Class aclass = a.getClass(); If we
- 4. Getting the class name Class c = myObject.getClass(); String s = c.getName(); An object of type
- 5. Research modifiers class Class c = obj.getClass(); int mods = c.getModifiers(); if (Modifier.isPublic(mods)) { System.out.println("public"); }
- 6. Finding the superclass Class c = myObj.getClass(); Class superclass = c.getSuperclass(); To get all parent superclasses
- 7. Research information on the method , the method call . Class c = obj.getClass(); Method[] methods
- 8. Research information on the method , the method call . Methods getMethod () and getMethods ()
- 9. Research information on the method , the method call . Class c = obj.getClass(); Class[] paramTypes
- 11. Скачать презентацию