TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Convert the String to Float & Double data type in Java Program
Alagunila Meganathan
Aug 08
2016
Code
908
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
ConvertStringToFloat
public
class
ConvertStringToFloat{
public
static
void
main(String[] args) {
System.out.println(
"Convert string to float example!"
);
String str =
"5"
;
Float f =
new
Float(str);
double
d = f.doubleValue();
System.out.println(
"float value:"
+f);
System.out.println(
"double value:"
+d);
}
}
java
string
double