Java-将字符串转为数字

package com.tj;

public class MyClass implements Cloneable {
    public static void main(String[] args) {
        byte b = Byte.parseByte("123");
        short s = Short.parseShort("123");
        int i = Integer.parseInt("123");
        long l = Long.parseLong("123");
        float f = Float.parseFloat("123.4");
        double d = Double.parseDouble("123.4e10");
    }
}
原文地址:https://www.cnblogs.com/linma/p/3672834.html