java - Entering int in a string variable -


i ask user enter name(string) , age(int), if user enters number in name space "crashes". can stop program crashing. im using java.

are casting input int, or leaving string? once take in input need convert string int. int age = integer.parseint(ageinput);


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -