















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















Docsity.com
Docsity.com
Docsity.com
static void printSuperclasses(Object o) { Class subclass = o.getClass(); Class superclass = subclass.getSuperclass(); while (superclass != null) { String className = superclass.getName(); System.out.println(className); subclass = superclass; superclass = subclass.getSuperclass(); } } Docsity.com
getModifiers() that returns an int
of the Modifier class, which is in java.lang.reflect, so: import java.lang.reflect.*;
if (Modifier.isPublic(m)) { System.out.println("public"); Docsity.com
Docsity.com
interfaces
interface, use c .isInterface()
be accessed with:
Docsity.com
Docsity.com
array,
that provides static methods for working with arrays Docsity.com