Java Program to Print String from User Input with Explanation

preview_player
Показать описание
#java
print #string in java.
Java Program to Print String from User Input with Explanation

All Java Programs | Java Coding Interview Questions:

This Java program is used to print on the screen input by the user.

This Java program asks the user to provide a string and prints it.

-Scanner class and its functions are used to obtain inputs, and println() function is used to print on the screen.
-We also required to create a object of Scanner class to call its functions.
-There are functions available to obtain string input:
nextLine() function for string input

Other query:
Java Program to Get User Input and Print on Screen
print string in java
user input as string in java
Рекомендации по теме
Комментарии
Автор

If there is a space between two words then what to do.
For example if I want to print "Hello My name is Akash" them what to do.
It is printing first word only. ie, Hello

Akash-phft