Miêu tả

Phương thức Double.parseDouble() là phương thức static của lớp Double để chuyển đổi String thành Double.

Cú pháp

public static double parseDouble(String s)  

Ví dụ

public class HTKQ {
public static void main(String args[]) {
String s = "30.3";
double d = Double.parseDouble("30.3");
System.out.println("Gia tri cua d la: " +d);
}
}
Chạy chương trình Java trên sẽ cho kết quả:
Gia tri cua d la: 30.3
Axact

Axact

Vestibulum bibendum felis sit amet dolor auctor molestie. In dignissim eget nibh id dapibus. Fusce et suscipit orci. Aliquam sit amet urna lorem. Duis eu imperdiet nunc, non imperdiet libero.

Post A Comment:

0 comments: