Returns a Float instance representing the specified float value. If a new Float instance is not required, this method should generally be used in preference to the constructor Float(float), as this method is likely to yield significantly better space and time performance by caching frequently requested values. Parameters: f - a float value.Returns: a Float instance representing f.
1. In the MainActivity.java file, add a Toast which displays the value of String.valueOf(3.567f);
Toast.makeText(this, String.valueOf(3.567f), Toast.LENGTH_LONG).show();
2. Compile and run!
3. The display results will be (as a string): 3.567
Resources:
http://docs.oracle.com/javase/7/docs/api/java/lang/Float.html#valueOf(float)
2. Compile and run!
3. The display results will be (as a string): 3.567
Resources:
http://docs.oracle.com/javase/7/docs/api/java/lang/Float.html#valueOf(float)