What will be the value of the parameter i.e. private static boolean ask(int i){int te = 8 + i;} Coz i notice the ‘i’ was use in the method. I just wonder what will be the value of that ‘i’ and/or what’s the use of it?
What will be the value of the parameter i.e. private static boolean ask(int i){int
Share
The value of
iwill be whatever the caller of the method passed into the method call.So if someone called
then
iwill be5within that specific invocation. Parameter values are specific to the particular invocation of the method, must be supplied each time and will be evaluated anew each time. Even if multiple threads are calling the method simultaneously, each will see the value ofithat they passed in.