Java Float toString() MethodThe toString() method of Java Float class returns a string illustration of this Float. The primitive float value that corresponds to this Float is converted to a String same as done by toString() method of one argument. Syntax:Parameters:NA Return Value:The toString() method returns a String illustration of this Float object. Example 1Test it NowOutput: 1. 9876.0 Converted to String = 9876.0 2. 1001.0 Converted to String = 1001.0 3. Concatenated String = 9876.01001.0 Example 2Test it NowOutput: Enter your password:923 Your password + 18 = 923.018 Example 3Test it NowOutput: 1. Sum = -126.0127.0 String value = -Infinity String value = 3.4028235E38 2. Sum = -Infinity3.4028235E38
Next TopicJava Float
|