Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Formal and real parameters of arrays in JAVA
Formal and real parameters of arrays in JAVA
Package demonstration;

Open class demonstration {

Private static void f1(int [] array) (

for(int i:array){

system . out . println(I);

}

}

Public static void main(String[] args) {

int[]array = new int[5];

for(int I = 0; I < array. Length; i++){

array[I]= I;

}

F 1 (array);

}

}

//Description: The array array in the main method is a real parameter, while the array array in the method f 1 is a formal parameter.