如何在 Java 中将一个 String 转换为 int
以下示例将一个 String 转换为 int。
示例
public class Tester {
public static void main(String[] args) {
String intString = "1234";
int value = new Integer(intString).intValue();
System.out.println(value);
}
}输出
1234
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
安卓
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP