I am having a very odd result in my Android program when adding two numbers. It is the test code I am using to find out what is going out:
private static final float yChannel[] = {12.0f, 8.0f, 4.0f, 0};
protected void onCreate(Bundle savedInstanceState) {
Log.i("Rectangles","y1: " + yChannel[0]+2.0f);
Log.i("Rectangles","y2: " + yChannel[0]);
}
The LogCat result is:
y1: 12.02.0
y2: 12
I simply don’t understand all the variables are float. My code is not working because it is not giving the correct result. I also tried cleaning Eclipse project.
is string concatenation, as the first operand is the string.
try this
or