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 -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -