- 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
Convert String to Double in Java
Let’s say the following is our string −
String str = "55.2";
Now, convert the above string to double using parseDouble() in Java −
double res = Double.parseDouble("23.6");
Example
Following is the program to convert String to Double in Java −
public class Demo { public static void main(String args[]){ String str = "55.2"; double res = Double.parseDouble("23.6"); System.out.println("Double (String to Double) = "+res); } }
Output
Double (String to Double) = 23.6
Advertisements