|
JAVA Pass
by Value
Rodelio P. Barcenas
The example program below shows how data are passed to a method
for processing;
public class returnType{
public
static void main(String arg[]){
int
a;
increment(a);
}
public void increment(int
x){
x
= x + 1;
System.out.println(x);
}
}
the value of int a is passed by value to increment()
method:
|