In this post I will explain how to create array dynamically with an example. This is useful when we don’t know the type of array until runtime. Main code 1 package reflection; 2 3 import java.lang.reflect.Array; 4 5 public class ArraysDemo { 6 public static void main(String[] args) { 7 //Creating single dimension array 8…… Continue reading Creating array dynamically
Category: Reflection
Creating dynamic proxy objects
This post explains how to create proxy objects using Java Proxy api. We need the below items to create a proxy. 1) proxy interfaces (list of interfaces the dynamic proxy class will implement). 2) dynamic proxy class is proxy class generated at runtime and implements the proxy interfaces. 3) proxy instance is an instance of…… Continue reading Creating dynamic proxy objects