Why the input commands don't work? | Sololearn: Learn to code for FREE!


Why the input commands don't work?

I just can't run my program and That's because I don't know how to write the Input commands here. I wrote "reader.nextInt();" But it didn't work.. https://code.sololearn.com/ck4Wqhdu1Ypm/?ref=app

1/8/2020 7:48:52 PM

Israel Cohen

3 Answers

New Answer


here it is import java.util.*; public class Program { public static void main(String[] args) { int Num, Max; /* Hello, please follow the commands bellow~ */ Scanner reader = new Scanner(System.in); Num=reader.nextInt(); Max = reader.nextInt(); if(Num>Max) Max=Num; else Max=Max; } }


You haven't imported and instantiated Scanner Class


Oh, thank you a lot. I guess I used to write it without the System in command cause when we learn at school we write codes in our Notebooks. Thank you for fixing my Program!