Taking input integer as string

How do I take integer input in the form of String?q
q

You can take string input using

String s = scan.next();

If now you give an integer as input, it will be taken in the form of a string.

So if we make String, then can we take o othe4 Dta Types also As Input.

Yes, you can do that but do remember that if you take input in form of string, it will have properties of string only. For example, if you take 34 and 83 input as strings and try perform addition on them, you will get the answer as 3483 (concatenation) instead of 117.

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.