java - Converting character inputs into numerical variables -


consider following input example:

user_input> x

which read following code:

scanner scan= new scanner(system.in);  string s = scan.nextline(); 

is possible declare numerical variable has same name of string read?

in order convert string integer, use integer.parseint() method.

for long types, long.parselong(). , on.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -