小编Rin*_*ino的帖子

使用Scanner在简单Java程序中编译错误

import java.util.*;
public class strings {
    public static void main (String [] args) {
        Scanner keyboard = new Scanner(System.in);
        System.out.print("Type your first integer: ");
        int first = keyboard.next();
        System.out.print("Type your seconds integer : ");
        int second = keyboard.next();
        System.out.print("The sum of your two integers are:");
    }
}
Run Code Online (Sandbox Code Playgroud)

我不知道为什么我在字符串上得到2个错误无法转换为int.

java compilation

2
推荐指数
1
解决办法
766
查看次数

标签 统计

compilation ×1

java ×1