I have a file scanner that reads from a file, a bunch of numbers (doubles) and stores them in tmpVal[]. I would then like to pass it to another method (make_abs_val) to get the absolute value of those numbers, so I can print it to a textview and/or write it to a file. What I'm not sure about is using the new array after I abs value it... I'm getting ".class expected" . . .
//get from file into first array
//this is all part of the mainActivity
while(fileScn.hasNext()){
val = fileScn.nextDouble();
tmpVal[arrayNum] = val;
arrayNum++;
}
// this is where I'm getting the error, not sure what to do.
make_it_abs(tmpVal[]);
//output to textview
for (int a = 0; a < arrayNum; a++ ){
txtVw.setText(String.format("%.2f", /*Not sure what variable to use */) + "\n");
}
//required method to get abs val
public double[] make_it_abs(double orig[]){
for(int i=0; i < orig.length; i++){
orig[i] = Math.abs(orig[i]);
}
return orig;
}