Methods : Make my method with many input variables with out overloading
Posted
by
Jack Jon
on Stack Overflow
See other posts from Stack Overflow
or by Jack Jon
Published on 2012-10-10T21:17:42Z
Indexed on
2012/10/10
21:37 UTC
Read the original article
Hit count: 265
is there Any Way To Make my Method Take many input variable but with out overloading ... could be my question not clear ... I mean Like That :
if I Have This Method
public void setValues (int val1,int val2 ,String val3){
}
what I want is : use this method with many way
setValues (val1,val2)
OR
setValues (val3)
why I want to do that with out overloading : Because if i have as example 10 variable i want to add many method with overloading but i don't like that ...
is there any way helps me to check variable or skip it in the same method ..
Thanks for help .
© Stack Overflow or respective owner