System.out.println("-----------------------------------------------------------");
System.out.println("Please select a task");
System.out.println("1: List employees with details");
System.out.println("2: List of clients in state");
System.out.println("3: List portfolio of client");
System.out.println("4: Release an employee");
System.out.println("5 Display stocks available for purchase/selling");
System.out.println("6: Display client details");
System.out.println("7: Buy Stock for client ");
System.out.println("0: Exit program");
System.out.println("-----------------------------------------------------------" + "\n" + "\n");
System.out.print("Input:");
Scanner scan = new Scanner(System.in);
input = scan.nextInt();
if (input == 1)
{
System.out.println("length of array list: " + employeeList.size());
int index = 0;
while (index < employeeList.size())
{
System.out.println(employeeList.get(index));
index++;
}
}
else if (input == 2)
{
String state_choice;
System.out.println("Please enter the abbrivation for the state:");
state_choice = scan.nextLine();
이것은 현재 코드에서 가져온 부분입니다. 실제로 무시합니다. 나는 이전 엔트리에서 "\ n"때문에 그것을 생각한다. 내 항목 앞에 다른 scan.nextLine()을 넣지 않고 "\ n"또는 추가 문자를 제거 할 수있는 방법이 있습니까? java 문서에서 아무 것도 볼 수 없었습니다.문자열 java null 문자 nextLine()
네 감사합니다 :) –