read input in java

Solutions on MaxInterview for read input in java by the best coders in the world

showing results for - "read input in java"
Serena
05 Jan 2020
1Scanner sc = new Scanner(System.in);  // Create a Scanner object
2String userName = sc.nextLine();//read input string
3int age = sc.nextInt(); //read input integer
4long mobileNo = sc.nextLong(); //read input long
5double cgpa = sc.nextDouble(); //read input double
6System.out.println(userName);//output 
Layana
23 Sep 2019
1Scanner sc = new Scanner(System.in);
2String s = sc.next();
3int n = sc.nextInt();
4double d = sc.nextDouble();
5float f = sc.nextFloat();
6
7// more fast way
8BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
9String s = br.readLine(); // read line
10int c = br.read();        // read single char
Mathilda
06 Nov 2016
13 ways to read input from console in java
2-----------------------------
3
41. Using BufferedReader Class
52. Using Scanner Class
63. Using Console Class 
7
8//bufferedreader class
9
10import java.io.BufferedReader;
11import java.io.IOException;
12import java.io.InputStreamReader;
13...
14public static void main(String[] args) throws IOException
15...
16BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
17String name = reader.readLine();
18
19//Scanner class
20
21import java.util.Scanner;
22...
23
24String name = new Scanner(System.in);
25
26//Console class:
27
28String name = Syste.console().readLine();
queries leading to this page
iser input javainput string command java 22 24input 22 javajava read in user inputjava code to accept input from usergetting user input in javatake input from user javaread a string in javahow to take the user input in javajava input stringjava user inputhow to make a input javamake an input javaread different type of inputs in javahow to get string input in javahow to take user in put in javajava inputusr input javajava system inputinput a string in javataking input in javaread system input javajava take inputhow to accept string input in javaaccept input from user in javahow to ask for input in javainput method javahow to get input javainputs en javahow to take string input in javainput java programsystem input javascanner input 3d new scanner 28system in 29input string in javajava program get input from userread input javainput javainout number in javataking string input javahow to give input in javainput in javasimple java program to take input from userhow to take input n javajava ask inputhow to have a user input in javahow to input string in javaget input from user in javahow to input in javajava input codehow to get input in javainput javahow to take a statement as input in javahow to display input in javauser to string javajava take input from usertake user input string in javainput in take in javajava taking input from userjava read from inputhow to get user input in javapromp user input javasyntax method that takes a string input in javajava how to input stringhow to take inputs javataking input from user in javainput syntax in javajava get input from userhow to get runtime value for string in javahow to use input in javauser input prompt javajava inputsjava taking inputhow to get string value input form user in javainputing values in javajava get user inputhow to read input from user in javatakinging input in javatake input in javahow to take input in string in javainput jin javainput statement in java java read inputdetect user input javatake user input javatake input from user in javajava entry by userhow to write an input in javastring in put in javaask for string input javahow to take user input in javainput from user in javataking input in java from command linehow to read input in javainput statements in javahow to read input javaeasiest way to get input in javahow take inputs in java with messagejava get input user system incapture input javahow to get input string in javaget input javajava how to take in an inputhow to take java inputuser input javatake string input in javaread the input in javajava how to rtake user inputhow to take inputs in havainput in java using scannerjava input like python input 28 29how to uwse input in javainput 28 29 in javainput string from user in javasystem input sintace javastring input javahow to take input in javause input in javainput string javauser input in javajava take input as stringjava input from usertake input string in javahow to get input from user in javaget user input in javataking input from javatake a string input in javahow to get input value in javajava get inputjava get udser inputread entry javaget input from user javaget input in javahow to read string in javahow to take the input from user in javainput numbers in javatak einput from user in javawhat is input in javastring input in javajava how to get user inputread input in javaread input in java