i'm not sure if this might help. you can try declare String res before starting the loop.
On Jan 23, 12:34 pm, teddybear <[email protected]> wrote: > Hi..... I seem to have a problem with my static method... The compiler > says that it cannot resolve variable "res" I dunno what to do pls > help.... thnx > > here's my code for the static... > > public class MyOwnBuiltinClassesProject { > > public static String generateNewName(String[] p){ > int i = 0; > while(i < p.length){ > String res = p[i].replace(p[i].charAt(1),' '); > i++; > } > return res.trim(); > } > > public static void main(String[] args){ > // I didn't start my main yet.... > } > > } > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
