0

How to give users input data to code like in C Print f & Scan f like that how to do in java ??

In Java

27th Mar 2017, 5:52 AM
Ganesh
Ganesh - avatar
3 Réponses
+ 1
pls will you explian it
27th Mar 2017, 6:10 AM
Ganesh
Ganesh - avatar
+ 1
how it works
27th Mar 2017, 6:11 AM
Ganesh
Ganesh - avatar
0
Quick example: start by importing java.util.Scanner, then in your function, write: int x; Scanner scan = new Scanner(System.in); System.out.print("Enter a number: "); x = scan.nextInt(); System.out.println("Your number is " + x);
27th Mar 2017, 6:09 AM
DaemonThread
DaemonThread - avatar