Como posso limitar as casas decimais do vetor B[i]?
public static void main(String[] args) {
int A[] = {6, 7, 23, 16, 2, 36, 49, 12, 87, 130, 166, 25, 256, 289, 324};
double B[] = new double [15];
for(int i=0; i<A.length; i++){
B[i] = Math.sqrt(A[i]);
}
System.out.println(Arrays.toString(A));
System.out.println(Arrays.toString(B));
}
}