0
How to fix this error
4 Answers
+ 3
public class Program
{
public static void main(String[] args) {
String a = "Minecraft";
switch(a){
case "Pubg":
System.out.println("hello");
break;
case "Minecraft":
System.out.println("Nice game");
break;
default:
System.out.println("Not in my list");
}
}
}
+ 2
Write string inside "
+ 2
š®š³Omkarš you are right thanks
+ 1
Muhammadamin ,
In Java, We can't use single quote ' for strings. It's used for characters. String literals require double quotes ".
It's not same as Python or JS.