Working with Java Reflection
Java reflection gives flexibility of controlling java application's behavior runtime. This tutorial explains using java reflection to load, instantiate and access member dynamically. Some simple and straight forward steps to use reflection are 1. Load class and get reference to Class Object [ using default class loader or custom one ]get required class properties using Class Object such as constructor, methods, fields etc 2. Instantiate class either using specific constructor or default one. 3. Invoke methods using object reference. Here , class MyCar is being accessed using reflection by TestRefelction class. MyCar package reflectionproject; public class MyCar { /** * private memebrs */ private String modelName; private String color; public static String parkingSlot; /** * default constructor */ public MyCar() { } public MyCar(String modelName, String col...