📄 stringtonumberdemo.java~20~
字号:
package conversion;public class StringToNumberDemo { public static void main(String[] args) { String string1 = "22"; byte byte1 = Byte.parseByte(string1); string1 = "128"; short short1 = Short.parseShort(string1); string1 = "1285"; int int1 = Integer.parseInt(string1); string1 = "12855"; long long1 = Long.parseLong(string1); string1 = "123.23"; float float1 = Float.parseFloat(string1); string1 = "123.23"; double double1 = Double.parseDouble(string1); System.out.println("byte1 = " + byte1); System.out.println("short1 = " + short1); System.out.println("int1 = " + int1); System.out.println("long1 = " + long1); System.out.println("float1 = " + float1); System.out.println("double1 = " + double1); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -