0

Does anyone tell me what is the data type of the variable that are going to assigned to user input scanner variable

29th Mar 2020, 7:08 PM
Abdullah Shahzad
Abdullah Shahzad - avatar
2 Answers
+ 5
Hello Abdullah Shahzad Scanner scan = new Scanner(System.in); integer: scan.nextInt(); double: scan.nextDouble(); String: scan.next() for one word or scan.nextLine() takes the whole string with spaces You can do this with a lot of data types: nextFloat() or nextBigInteger() and so on.
29th Mar 2020, 7:22 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Thanks
30th Mar 2020, 10:39 AM
Abdullah Shahzad
Abdullah Shahzad - avatar