如何在 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
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP