0
How to get input any data by user in java.
2 Réponses
+ 2
Scanner,joptionpane
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();