+ 6

Why this cord didn't work?

import java.util.Scanner ; class Program { public static void main(String[] args) { Scanner age = new Scanner (System.in) ; age.nextint (); if(age <= 0) { System.out.println("Error"); } else if(age <= 16) { System.out.println("Too Young"); } else if(age < 100) { System.out.println("Welcome!"); } else { System.out.println("Really?"); } } }

21st Sep 2018, 3:40 PM
Supun Dissanayake
Supun Dissanayake - avatar
4 ответов
+ 5
it didn't show me anything.Supriya can you just copy the cord,instead of givning a link.
24th Sep 2018, 12:04 PM
Supun Dissanayake
Supun Dissanayake - avatar
+ 4
I think it should be like this..... scanner ag=new scanner(system.in); int age=ag.nextInt(); Am I right ?
24th Sep 2018, 12:15 PM
Supun Dissanayake
Supun Dissanayake - avatar