Java 获取用户输入
package com.geekeryi; import java.util.Scanner; public class TestScanner { public static void main(String[] args){ Scanner s = new Scanner(System.in); System.out.println("请输入您的用户名:"); String name = s.nextLine(); System.out.println("请输入您的年龄:"); int age = s.nextInt(); System.out.println("请输入您的月薪:"); double monthSalary = s.nextDouble(); System.out.println("用户名:"+name+" 年龄:"+age+" 月薪:"+monthSalary+" 年薪:"+(12*monthSalary)); } }