1つのprintlnで複数の文字列変数を設定しようとしています。これが私が持っているものです:
Scanner scanner = new Scanner(System.in);
String teacher = "";
String classSelect = "";
String location = "";
System.out.println("Enter a teacher: ");
teacher = scanner.next();
System.out.println("Enter a class name: ");
classSelect = scanner.next();
System.out.println("Enter a location: ");
location = scanner.next();
これが私が達成したいことです:
String section = "";
String instructor = "";
String location = "";
System.out.printf("Only fill in applicable criteria, leave the rest blank :\n"
+ "Section://Sets section var// \n"
+ "Instructor://Sets instructor var// \n"
+ "Location://Sets location var// \n");