Is it possible to make the method run differently depending on the length of the transmitted array (0, 1, 2 or 3)? And solve this problem with overload.
Those. in each case, we actually transfer a different number of parameters from 0 to 3.
I pass an array whose length varies from 0 ( null ) to 3 elements. Depending on the length of the transmitted array, the method varies slightly.
While I thought up foolishly:
if (currOper.length == 0) { expVal = expValDet(); } if (currOper.length == 1) { expVal = expValDet(currOper[0]); } if (currOper.length == 2) { expVal = expValDet(currOper[0], currOper[1]); }
количество параметров от 0 до 3-хor theдлины передаваемого массива 0 1 2 3? Maybe more specific? - Alexey Shimansky