Determine If an Object Is an Array in Java
Description
The following code shows how to determine If an Object Is an Array.
Example
/*from w ww .j av a2 s. c o m*/
public class Main {
public static void main(String[] argv) throws Exception {
boolean b = "".getClass().isArray();
if (b) {
System.out.println("object is an array");
}
}
}
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »