is it right? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

is it right?

import java.util.Scanner; class Myclass{ public static void Main(String [] args){ Scanner dog = new Scanner(System.in); System.out.println("Type ur age,u will get a discount if u are under 18!"); int age = dog.nextInt(); if (age < 18){System.out.println("congrats,u get the discount!"); } } }

22nd Jan 2019, 10:12 AM
Tzion
Tzion - avatar
3 Answers
+ 16
Hy ButterflyKnives YT Java Code-playground is working correct ☺ ● notice your main() method again //replace "Main" by "main" 👍
22nd Jan 2019, 8:42 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
Do it run well?
22nd Jan 2019, 11:17 AM
ShortCode
+ 1
ShortCode time limit exceed :)
22nd Jan 2019, 12:09 PM
Tzion
Tzion - avatar