sir how can we take more than one integer input in a single line…as given in the mwntioned questioned
Challenges recursion (quicksort )
Hi sameeksha
To take more than one data type input from a single line, you can use 2 methods.
First one is based on the scanner class where you can use its scanner.next() function to take in the next input from the scanner cursor. The next function takes in the next token from the cursors position. So even if there are multiple tokens on the same line, you can take them all individually via the next function.
Another method is to use the string class to take in the whole line as input to a string using scanner.nextLine() and then break this string into the different data types using the integer and character wrapper classes.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.