How to receive and print the information entered by the keyboard in the development of big data
This article will explain in detail how to receive and print keyboard input information in big data's development. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Prompt the user for name and age information System.out.println ("Please enter name and age:")
Create a scanner to scan keyboard input. System.in stands for keyboard input: Scanner sc = new Scanner (System.in)
Read a string data into name through the scanner: String name = sc.next ()
Read an integer data into age through the scanner: Int age = sc.nextInt ()
Print message System.out.println ("name:" + name + ", age:" + age)
This is the end of the article on "how to receive and print keyboard input in big data's development". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, please share it for more people to see.