0
What is syntax used for accepting input values in java
7 Antworten
+ 18
SoloLearn Java course covers this question.
Java course -> Basic Concepts -> Getting user input.
+ 10
import java.util.Scanner;
//in the program
Scanner s=new Scanner(System.in);
s.next();//for String input
s.nextInt();//for Integer
s.nextDouble();//for decimal
+ 3
import java.util.*;
public class Example
{
public static void main (String[] args)
{
Scanner in= new Scanner(System.in)
int i=in.nextInt();//Integer
char c=in.next().charAt(0)//Character
String s=in.nextLine();//Sentence
double d=in.nextDouble();//Double Decimal
float f=in.nextFloat();//Floating Decimal
long l=in.nextLong();//Long Number
String word=in.next();//Word
}
}
//Hope I helped...
0
3
0
j
0
First .
I p7
I m
0
illp