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
Post a Comment