This is my code:
public float[] DataSet() {
float[] Data = {1.51,2.35,3.36};
return Data;}
Why do I get the error message:
This method must return a result of type float[]
The literals, 1.51 etc. are implicitly double. That's how Java interprets them.
See Primitive data types in Java.
If you want a float array, try postfixing them with f.
float[] Data = {1.51f, 2.35f, 3.36f};