User Input

  • Eclipse: Oxygen
  • Java: 1.8

Sometimes, we can face a situation where we need to get information from the user at runtime. We use the “Scanner” class to accept user input to obtain user information. The Java Scanner class comes under java.util.package. For using the Scanner class, we need to import the java.util.package in our program.

This tutorial tries to take information from the user using the Scanner class. There were several types of data as we have seen previously.

The syntax for each of the data types is discussed here. Therefore, the user may receive information from the user.

 

Output

Whats your age?

Contributed by: Poonam Tomar


VIEW COURSES

Buy me a coffee!

 

PayTM QR (INDIA)

  • Get video tutorials
  • Project files set
  • Get┬áCertified

Leave a Reply

avatar
  Subscribe  
Notify of
Close Menu