InterviewSolution
Saved Bookmarks
| 1. |
JAVA how to take user input |
|
Answer» Example of String Input from userExplanation:1. import java.util.*;2. class UserInputDemo1.3.{4.public static VOID main(String[] args)5.{6.Scanner sc= NEW Scanner(System.in); // System.in is a STANDARD input stream.7.System.out.print("Enter a string: ");8.String STR= sc.nextLine(); //READS string |
|