提交 f04c981c 编写于 作者: 沉默王二's avatar 沉默王二 💬

Create String2int.java

上级 1500a84c
package com.cmower.java_demo.mkyoung;
public class String2int {
public static void main(String[] args) {
//String number = "10";
//int result = Integer.parseInt(number);
//System.out.println(result);
//String number = "10";
//Integer result = Integer.valueOf(number);
//System.out.println(result);
String number = "10A";
int result = Integer.parseInt(number);
System.out.println(result);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册