+ 1

how can we in most basic way put our input into Java code, can we write like this is not pls tell system.scanf(n);

2nd Sep 2016, 3:21 PM
Abhijay Bisht
Abhijay Bisht - avatar
6 Respostas
+ 3
for geting input from user we can use scanner class. i learnt in netbeans. acording to tat i wil tel u wat i do.. frst type import java.util.*; (below package). (v must do this first to use scanner class.) then type Scanner s=new Scanner(System.in); System.out.println("enter n:") //input n int n=s.nextInt(); //for accepting ur integer value System.out.println(+n); //to display n u can creat scanner clas lik how i did n iput values.. hope u can understand....sorry if i confused u...
2nd Sep 2016, 3:32 PM
abi
+ 1
hey this is how i do to get d input.
2nd Sep 2016, 3:41 PM
abi
+ 1
yes lik tat if u need a string to be ur input u can use next(); or for double nextDouble(); it goes lik tat...
2nd Sep 2016, 5:02 PM
abi
0
man want I want to is how to take given input value
2nd Sep 2016, 3:36 PM
Abhijay Bisht
Abhijay Bisht - avatar
0
hey where did this "nextlnt" come from and it's meaning
2nd Sep 2016, 3:44 PM
Abhijay Bisht
Abhijay Bisht - avatar
0
nextInt () is a method of the scanner class, it basically says thats its getting an integer input from the user
2nd Sep 2016, 3:49 PM
Romario Teixeira
Romario Teixeira - avatar