28th Jan 2020, 5:01 PM
GEImpLEER
GEImpLEER - avatar
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.
28th Jan 2020, 5:10 PM
A͢J
A͢J - avatar
+ 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
28th Jan 2020, 5:11 PM
Avinesh
Avinesh - avatar
+ 1
What are you exactly trying to do and what is the code all about?
28th Jan 2020, 5:05 PM
Avinesh
Avinesh - avatar
0
Must ask age and then answer written java
28th Jan 2020, 5:08 PM
GEImpLEER
GEImpLEER - avatar