- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Program to convert float to String
The valueOf() method is used in Java to convert float to string.
Let’s say we have the following float value.
float val = 10.18465F;
Converting the above float value to string.
String.valueOf(val);
Example
public class Demo { public static void main(String[] args) { float val = 98.18465F; // converting float to String String str = String.valueOf(val); System.out.println("String: "+str); } }
Output
String: 98.18465
Advertisements