need help with array

Hello everyone, my problem is getting values from array when i use return statement, thing is, everything works fine, i use JFormattedTextFields and blah blah other things, for example if i use:

when declared

double a1,a2,a3 ....=0;

double [] arr;

in init phase

double [] arr=new double[]{a1,a2,a3};

and when i have to get entered values i use PropertyChangeListener with return statement:

double something(double[] arr) {

double answer=0;

answer=a1+a2+a3;

return answer;

}

but next thing, which isnt working i dont know why:

double[] arr;

double x[];

public NewJFrame() {

x=new double[3];

for(int i=0;i<x.length;i++){

x=0;

double[] arr=new double[]{x};

}

initComponents();

}

blah blah (lot of code)

double something(double[] arr) {

double answer=0;

answer=x[0]+x[1]+x[2];

return answer;

}

It shows that build is successful, but nothing shows up, if i disable answer=x[0]+x[1]+x[2]; it builds

so i guess something is wrong with values or theres something else i should know!>

[1184 byte] By [kode128a] at [2007-11-27 1:37:45]
# 1
The line x = 0 should be x = 0. You were trying to assign 0 to the array instead of each double in the array.
przma at 2007-7-12 0:48:47 > top of Java-index,Desktop,Core GUI APIs...
# 2

The original poster did write [i] but it was swallowed by the forum software.

(And the [i] in przm's response also got swallowed by the forum software

because the forum software thinks it means italic)

To the OP, please post your code again, but this time put your code between [code] and [/code]

KathyMcDonnella at 2007-7-12 0:48:47 > top of Java-index,Desktop,Core GUI APIs...