Im really confused by the whole pass by value thing.
Take this example from my book:
public class ch4question6
{
public static void main (String [] args)
{
int max=0;
max(1,2,max);
System.out.println(max);
}
public static void max (int value1, int value2, int max)
{if (value1>value2)
max=value1;
else
max=value2;
}
}
I know it means that a copy of the value outside the method is being passed on. So does this mean that "max(1,2,max)" is being passed on to the parameter "(int value1,int value2,max)"
k...im starting to realize this is a dumb question. let me know if im right.
ALSO, why is "int max=0" there? Whats the point of that statement? The program cant run without it, thats for sure.
THANKS!
[ November 05, 2003: Message edited by: Carolina Carvajal ]