+ 15
// lesson on taking input in Java :
https://www.sololearn.com/learn/Java/2220/
//U can declare variable of that type & assign it value using input method of that type listed in above lesson âşđ
+ 10
GETTING INPUT
To read an input value from the user, you can use one of the methods of the Scanner class that are listed below. As you can see, the primitive data type has a separate method.
Scanner Class Methods That Get Input Values:
⢠boolean - nextBoolean()
Reads a 'boolean' value from the user.
⢠byte - nextByte()
Reads a 'byte' value from the user.
⢠double - nextDouble()
Reads a 'double' value from the user.
⢠float - nextFloat()
Reads a 'float' value from the user.
⢠int - nextInt()
Reads an 'int' value from the user.
⢠String - nextLine()
Reads a 'String' value from the user.
⢠long - nextLong()
Reads a 'long' value from the user.
⢠short - nextShort()
Reads a 'short' value from the user.
+ 8