+ 2
It is not working, please help.
Switch with scanner case. https://code.sololearn.com/cixQelqQdZR3/?ref=app
6 odpowiedzi
+ 6
You had used wrong syntax in first line
+ 4
// Nelson Beltrán be careful, or just copy it:
import java.util.Scanner;
public class Program
{
+ 3
Thank you so much.
0
Now it says identifier expected
0
One period was fuc...ing me haha 😂
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.