java - How to check if all arguments in method are of specific type? -


i have method takes variable amount of arguments:

public void test(object[] ... args) {} 

how can check if all arguments double[]?

loop , make sure each object[] double[]. note cannot use primitive double here not object.

boolean alldoublearr = true; for(object[] o : args) {     if(!(o instanceof double[])) {         alldoublearr = false;         break;     } } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

dataset - MPAndroidchart returning no chart Data available -

post - imageshack API cURL -