Reputation: 6045
I'm new to java. Please let me know how to verify if variable type is an array in Java languge.
Upvotes: 1
Views: 153
Reputation: 8125
With any object, you can do this:
Class clazz = myObject.getClass();
if( clazz.isArray() ) {
// ... array specific stuff.
}
Upvotes: 7