Floating-Point Literal Loss of Precision ErrorThe compiler reports as error stating that your assignment of a floating-point literal to a variable of type float might result in a loss of precision. When you assign a floating-point literal to a float variable, you must explicitly specify the type suffix. When you omit the suffix, the compiler assumes that the literal is of type double , which cannot be assigned to a float without an explicit cast. The following two statements illustrate a correct and an incorrect assignment statement: float myFirstFloat = 1.0; // compiler error float mySecondFloat = 2.0F; // correct ArrayIndexOutOfBoundsExceptionAn ArrayIndexOutOfBoundsException occurs at runtime when you attempt to access an array's elements. Remember that the first index in a Java array is 0 and the last valid index is one less than the length of the array. For example: // create an array to hold two integer values int[] dataArray = new int[2]; // several correct data assignment statements dataArray[0] = 23; // valid assignment to first index dataArray[1] = 43; // valid assignment to last index dataArray[dataArray.length-1] = 50; // valid assignment to last index // runtime errors dataArray[2] = 55; // ArrayIndexOutOfBoundsException dataArray[dataArray.length] = 55; // ArrayIndexOutOfBoundsException |