0
What is problem?
4 Réponses
+ 3
According to your this problem:-
import java.util.Scanner;
//Спрашивает сколько лет.
class MyClass {
public static void main(String[] args) {
Scanner myVar = new Scanner (System.in);
System.out.println("Сколько Тебе Лет?");
System.out.println(myVar.nextLine()); {
}
//Принимает решение, если менчше 18 или больше.
if(System.in < 18)
if(System.in < 18) {
System.out.println("Маловат ты ещё!"); {
}else{
System.out.print("Проходи!");
}
---------------------------
Line no 14 is Wrong here. You have started to use Curly braces after print statement which is Wrong.
And also You have used same if condition.
And also you checked condition outside the main method.
Also you can't compare System.in with integer value.
You need to do more practice.
You can make program like Avinesh shared.
+ 2
Kindly revise the Java course again because you seem to forget and confuse a lot. I'm saying this because there are a lot of errors in the code.
See if this helps-
https://code.sololearn.com/cyQ2xm9aBkg0/?ref=app
+ 1
What are you exactly trying to do and what is the code all about?
0
Must ask age and then answer written java