📜  使用 java 代码示例从用户获取 string 、 double 和 int 值

📅  最后修改于: 2022-03-11 14:52:37.853000             🧑  作者: Mango

代码示例1
import java.util.Scanner;

public class Solution {

public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int i = scan.nextInt();
    double d = scan.nextDouble();

    scan.nextLine();
    String s = scan.nextLine();

    System.out.println("String: " + s);
    System.out.println("Double: " + d);
    System.out.println("Int: " + i);
}