我的代码:
import java.util.*;
public class ScreenCandidates
{
public static void main (String[] args)
{
Scanner scan = new Scanner(System.in);
//About You
System.out.println("\t\tAbout You");
System.out.println();
System.out.print("\nName: ");
String name = scan.nextLine();
System.out.print("\nLocation: ");
String location = scan.nextLine();
System.out.print("\nLanguages: ");
String languages = scan.nextLine();
System.out.print("\nHighest Level of Education: ");
String education = scan.nextLine();
System.out.print("\nGPA: ");
double gpa = scan.nextDouble();
//Your Professional Goals
System.out.println("\t\tYour Professional Goals ");
System.out.print("\nIndustry (current or target): ");
String industry = scan.nextLine();
//Work History
System.out.println("\t\tWork History ");
System.out.println();
System.out.print("\nCurrent Title: ");
String currentTitle = scan.nextLine();
System.out.print("\nCurrent Employer: ");
String currentEmployer = scan.nextLine();
System.out.print("\nPrevious Titles: ");
String previosTitle1 = scan.nextLine();
System.out.print("\nFormer Employer: ");
String formerEmployer = scan.nextLine();
//Qualifications, Skills and Accomplishments
}
}当我运行代码时:
关于你
姓名: Peter
地点: 07430
语言:德语
最高学历:副学士学位
GPA: 3.95你的职业目标
行业(当前或目标):工作历史记录
当前标题: Java程序员
现任雇主: Verizon
前职称:教师
前雇主: Jonas Salk中学
发布于 2015-08-14 15:40:11
在double gpa = scan.nextDouble();之后添加一个newline,以获取调用nextDouble()留下的newline
https://stackoverflow.com/questions/32013769
复制相似问题