Determining If an Object Is an Array - Java Reflection

Java examples for Reflection:Array

Description

Determining If an Object Is an Array

Demo Code


public class Main {
  public static void main(String[] argv) {
    int[] object = new int[8];
    boolean b = object.getClass().isArray();
    if (b) {//from w w w.j av  a 2 s  .com
        // object is an array
    }
  }
}

Related Tutorials