java - Passing double values into 2D Array -
i'm trying initialize 2d array in java passing specific double values it, i'm returning error " ']' expected".
double[][] englishtofrenchprob = new double[2][3]; double[0][0] = 0.0; //unused double[0][1] = 0.08; double[0][2] = 0.06; double[1][0] = 0; //unused double[1][1] = 0.08; double[1][2] = 0.06;
what doing wrong, , realise there's easier way pass values 2d arrays way think can index them own values (which need do)
to set value have use variable's name:
englishtofrenchprob[0][0] = 0.00;
you can use following syntax:
double[][] englishtofrenchprob = {{0.00, 0.08, 0.06}, {0.00, 0.08, 0.06}};
Comments
Post a Comment