-- Reflection is commonly used by programs which require the ability to examine or modify the runtime behavior of applications running in the Java virtual machine. The class java.lang.Class and the package java.lang.reflect (classes Array, Constructor, Field, Method, Modifier) implement Java's reflection. The methods of java.lang.Class are used to get information about a class. The methods of the classes in java.lang.reflect provide further information about a class and allow methods to be invoked. The following example shows how to get information about java.lang.String a class: public class Program { public static void main(String[] args) { try { Class clz = Class.forName("java.lang.String"); Field[] flds = clz.getDeclaredFields(); System.out.println("\nVariables..."); for ( int k = 0; k < flds.length; k++ ) { String name = flds[k].getName(); ...
About Java and it's related concepts..