n92
n92

Reputation: 7602

How to check for array in java

I am getting values params[point.id] . i want to check whether params[point.id] is array or not ,how to do this

Upvotes: 3

Views: 141

Answers (2)

mre
mre

Reputation: 44240

Try isArray(),

foo.getClass().isArray();

where foo is the Object in question.

Upvotes: 10

Joonas Pulakka
Joonas Pulakka

Reputation: 36577

This way: object.getClass().isArray()

Upvotes: 4

Related Questions