Я пытаюсь запустить Java в нано, на Mac.Я попытался создать файл класса java, но столкнулся с ошибкой: Class.java:3: class PrintLns is public, should be declared in a file named PrintLns.java
.
Вот код:
import java.util.*;
public class PrintLns {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
System.out.println("Type in a command");
String x = scanner.nextLine();
if (x == "Y"){
System.out.println("You said Yes");
}
}
}