you cannot compare values in string format you have to convert the 'String' type to 'int' type and then compare it with another 'int' There is a method to convert in the Integer class called parsInt() for example: int age = Integer.parsInt(agestr);
--- El mié 22-jul-09, ben <[email protected]> escribió: De: ben <[email protected]> Asunto: [java programming] comparing strings A: "Free Java Programming Online Training Course By Sang Shin" <[email protected]> Fecha: miércoles, 22 julio, 2009, 1:32 pm 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... ____________________________________________________________________________________ ¡Obtén la mejor experiencia en la web! Descarga gratis el nuevo Internet Explorer 8. http://downloads.yahoo.com/ieak8/?l=e1 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
