我已经创建了数组tablica {5,4,3,2,1},我的问题是:“如何从方法中输出数组选项卡
*
5
4
3
2
1
tablica with parameter +10
15
14
13
12
11
*
public class Main(){
static int[]tablica = {5,4,3,2,1};
void method(int[] tab) {
for(int i = 0;i<=tablica.length;i++){
tab[i] = tablica[i]+10;
}
}
public static void main(String[] args) {
for(int a = 0; a<tablica.length;a++) {
System.out.println(Main.tablica[a]);
}
System.out.println("and now output tablica with parameter +10");
for(int x = 0;x<=tablica.length;x++){
// How can to output *tab* from method with parameter +10 ?
}
}
}