0

How to get input any data by user in java.

20th Dec 2016, 1:00 PM
Md khalid
2 Réponses
+ 2
Scanner,joptionpane
20th Dec 2016, 1:27 PM
Doolitha Samaranayake
Doolitha Samaranayake - avatar
0
import java.util.*; public class Program { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Input: "); int num = input.nextInt(); } } for integer: int num = input.nextInt(); for double: double num = input.nextDouble(); for string: String num = input.nextLine();
21st Dec 2016, 1:58 AM
lowshuen