Homework question,
 "# Display the entered age as following
    * If the age is over 100, display
          o Hello <name>, you are old!
    * Otherwise
          o Hello <name>, you are young! "

I created
String age = "";
'
'
age = JOptionPane.showInputDialog("Please enter your age:");


My question is: how do I accept an integer value and save it in a
string?

I googled this question and came up with this alternative which works
but I don't want to use solution since it has not been covered in this
chapter.

Solution --> " int i = Integer.parseInt(age);"

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to