Answers for "java take string as input"

14

taking string input in java

Scanner in = new Scanner(System.in);
String s = in.nextLine();
Posted by: Guest on April-27-2020
2

java read string input

import java.util.Scanner;
 
public class YourClass {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String inputString = scanner.nextLine();
        System.out.println("Your string: " + inputString);
    }
}
Posted by: Guest on March-14-2020

Code answers related to "java take string as input"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language