Java double type parse String to double

Description

Java double type parse String to double

public class Main {
    /*from ww  w.  j  a  v a  2s  .  c om*/
    public static void main (String[] args) {
        double pi;
        String strval;

        pi = Double.parseDouble("3.14");
        System.out.println(strval = String.valueOf(pi));
        System.out.println(Double.toString(pi));
    }
    
}



PreviousNext

Related