[Solved] Print array object int java [duplicate]


 System.out.print(Arrays.deepToString());//neither of them seems to be working
 System.out.print([0].Stringform());

This is dead code. It does nothing. In the first line you are asking the class Arrays to do something?? I’m not sure what you want to do there.

Also change the name of the Number() function it might have conflicts with Java. Also brackets and semicolons required:

public double [] arrayStuff() {
    double [] z;
    z = new double [2];

    z[0]= 12+5;
    z[1]= 58-8; 
    return z;
}

Here is my assumption of what you want:

additions  calculus_1 = new additions();
double[] result = calculus_1.arrayStuff();

for (int i = 0; i < result.length; i++) {
    System.out.println(result[i]);
}

solved Print array object int java [duplicate]