Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
How to use scanner in java?
Home
JAVA
How to use scanner in java?
0
votes
asked
Oct 18, 2020
in
JAVA
by
sharadyadav1986
How to use scanner in java?
#use-scanner-in-java
#java-scanner
#scanner
#java
Java-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Oct 18, 2020
by
rahuljain1
How to use scanner in java?
import java.util.Scanner;
class classname{
public methodname(){
//Scanner declaration
Scanner s_name = new Scanner(System.in);
//Use Scanner to take input
int val = s_name.nextInt();
}
}
...