+ 1

Scanner in java

What is the input function of java like scanf in c programming?

15th Aug 2018, 3:16 PM
Satya Chaitanya Yerninti
Satya Chaitanya Yerninti - avatar
2 Answers
+ 6
You have to import the Scanner class from the java.util package. You can inspect methods of the Scanner class here: https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html Be aware that you need to create an object of Scanner in your main method so you can get input.
15th Aug 2018, 3:36 PM
Eduardo Petry
Eduardo Petry - avatar
+ 1
thank u
16th Aug 2018, 2:13 AM
Satya Chaitanya Yerninti
Satya Chaitanya Yerninti - avatar