How takeinput function works?

How takeinput function works without using scanner class and its functions?

@piyushabhiranjan30,

takeinput function is defined by the user and is taking input using the scanner class only. Its the same code that is used to take input in an array.

The only difference is that it is inside a function so that we don’t have to write code for input again and again.