Here is my partial code:
public class Variable {
private double[] array;
public Variable(){
array[0] = 0.0;
}
public String toString(){
return array.toString();
}
public static void main(String[] args) {
Variable Var1 = new Variable();
System.out.println(Var1);
}
And I want to get the following output to simply be:
[0.0]
but for some reason there is still error. What am I doing wrong?