Computer Science, asked by AHERO, 9 months ago

what is the syntax for input of string by scanner class​

Answers

Answered by akathwal004
2

Scanner in = new Scanner ( System.in)

String s = in.nextLine();

hope this answer will be helpful ♥️♥️♥️

Answered by AskewTronics
0

Syntax to input a string using Scanner class :

Explanation:

The scaner class is used in java to take the inputs. When the user wants to take the input from the keyboard.

Then firstly he needs to create a object of the scanner class by the help of "Scanner object_name_or_variable_name = new Scanner( System.in); " syntax.

Then the user needs to use the object to take the input which syntax is "Data_type variable_name =object_name_or_variable_name.nextLine(); ".

Learn More:

  • Scaner class : https://brainly.in/question/513836
Similar questions