Convert the age to an integer and compare just like typical numbers

int age1int = Integer.parseInt(age1);
int age2int = Integer.parseInt(age2);
maxage = (age1int > age2int) ? age1int : age2int;

----- Original Message ----- 
From: "ben" <[email protected]>
To: "Free Java Programming Online Training Course By Sang Shin" 
<[email protected]>
Sent: Wednesday, July 22, 2009 11:32 AM
Subject: [java programming] comparing strings


>
> hi all,
>
> i want to know how to compare strings...
> for example if i get the age as a string... how can i compare them and
> get the largest value to print...
>
> thanks
>
> ben...
>
> > 


--~--~---------~--~----~------------~-------~--~----~
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