It seemed to solve a simple task, even then google the correct code ... But the console displays an array of a given value, which is filled with units. Tell me, what is the error?
public class Test { public static void main(String[] args) { prMass(fibMass(20)); } public static int[] fibMass(int x) { int m[]=new int[x]; for(int i=0;i<x;i++) { if(m[i]<2) m[i]=1; else m[i]=m[i-1]+m[i-2]; } return m; } public static void prMass(int[] x) { int z=x.length; for(int i=0;i<z;i++) { System.out.print(x[i]+" "); } System.out.println(); } }