+ 2

It is not working, please help.

Switch with scanner case. https://code.sololearn.com/cixQelqQdZR3/?ref=app

22nd Mar 2023, 4:43 PM
Nelson Beltrán
Nelson Beltrán - avatar
6 ответов
+ 6
You had used wrong syntax in first line
22nd Mar 2023, 5:09 PM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
+ 4
// Nelson Beltrán be careful, or just copy it: import java.util.Scanner; public class Program {
22nd Mar 2023, 4:51 PM
Solo
Solo - avatar
+ 3
Thank you so much.
22nd Mar 2023, 5:23 PM
Nelson Beltrán
Nelson Beltrán - avatar
0
Now it says identifier expected
22nd Mar 2023, 5:28 PM
Nelson Beltrán
Nelson Beltrán - avatar
0
One period was fuc...ing me haha 😂
23rd Mar 2023, 4:03 AM
Nelson Beltrán
Nelson Beltrán - avatar
0
sc = new Scanner() creates an instance of the Scanner class and stores a refrenece to it inside the sc variable. Inside this class are methods in which you can access. You do this by using the sc refrenece variable and the dot operator sc.nextInt(). hope this helps to understand what's happening.
24th Mar 2023, 8:18 AM
D_Stark
D_Stark - avatar