File tree Expand file tree Collapse file tree 5 files changed +13
-28
lines changed
compiled_starters/java/src/main/java
starter_templates/java/src/main/java Expand file tree Collapse file tree 5 files changed +13
-28
lines changed Original file line number Diff line number Diff line change 22// import java.util.Scanner;
33
44public class Main {
5-
65 public static void main (String [] args ) throws Exception {
7- // Uncomment this block to pass the first stage
8- // Scanner sc = new Scanner(System.in);
9-
106 // You can use print statements as follows for debugging, they'll be visible when running tests.
117 System .out .println ("Logs from your program will appear here!" );
128
139 System .out .print ("$ " );
1410 // Uncomment this block to pass the first stage
15- // String input = sc.next();
11+ // Scanner scanner = new Scanner(System.in);
12+ // String input = scanner.nextLine();
1613 }
1714}
Original file line number Diff line number Diff line change 11 import java .util .Scanner ;
22
33public class Main {
4-
54 public static void main (String [] args ) throws Exception {
6- Scanner sc = new Scanner (System .in );
7-
85 System .out .print ("$ " );
9- String input = sc .next ();
6+ Scanner scanner = new Scanner (System .in );
7+ String input = scanner .nextLine ();
108 }
119}
Original file line number Diff line number Diff line change 1- @@ -1,17 +1,11 @@
1+ @@ -1,14 +1,9 @@
22- // Uncomment this block to pass the first stage
33- // import java.util.Scanner;
44+ import java.util.Scanner;
55
66 public class Main {
7-
87 public static void main(String[] args) throws Exception {
9- - // Uncomment this block to pass the first stage
10- - // Scanner sc = new Scanner(System.in);
11- + Scanner sc = new Scanner(System.in);
12-
138- // You can use print statements as follows for debugging, they'll be visible when running tests.
149- System.out.println("Logs from your program will appear here!");
1510-
1611 System.out.print("$ ");
1712- // Uncomment this block to pass the first stage
18- - // String input = sc.next();
19- + String input = sc.next();
13+ - // Scanner scanner = new Scanner(System.in);
14+ - // String input = scanner.nextLine();
15+ + Scanner scanner = new Scanner(System.in);
16+ + String input = scanner.nextLine();
2017 }
2118 }
Original file line number Diff line number Diff line change @@ -9,12 +9,8 @@ Study and uncomment the relevant code:
99
1010``` java
1111// Uncomment this block to pass the first stage
12- Scanner sc = new Scanner (System . in);
13- ```
14-
15- ``` java
16- // Uncomment this block to pass the first stage
17- String input = sc. next();
12+ Scanner scanner = new Scanner (System . in);
13+ String input = scanner. nextLine();
1814```
1915
2016Push your changes to pass the first stage:
Original file line number Diff line number Diff line change 22// import java.util.Scanner;
33
44public class Main {
5-
65 public static void main (String [] args ) throws Exception {
7- // Uncomment this block to pass the first stage
8- // Scanner sc = new Scanner(System.in);
9-
106 // You can use print statements as follows for debugging, they'll be visible when running tests.
117 System .out .println ("Logs from your program will appear here!" );
128
139 System .out .print ("$ " );
1410 // Uncomment this block to pass the first stage
15- // String input = sc.next();
11+ // Scanner scanner = new Scanner(System.in);
12+ // String input = scanner.nextLine();
1613 }
1714}
You can’t perform that action at this time.
0 commit comments