English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

void disp ( ) {
int i=10;
duplicate ( i );
output(i);
}
static void duplicate (int i) {
i=i*2;
}

2006-11-13 17:01:41 · 2 answers · asked by HelpNeeded 1 in Computers & Internet Programming & Design

2 answers

The outpput will be 10. You are passing the parameter by values and not by reference. Hence the value of i will be unchanged from where you are calling the function.

2006-11-13 17:09:53 · answer #1 · answered by manoj Ransing 3 · 0 0

20

2006-11-14 01:03:30 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers