Yes, sure, "static" can only be used in classes, not inside of functions. As "static" denotes a class variable in contrast to an instance variable. A variable declared "static" exists only once for all instances of one class. So leaving the static out gives it a different meaning too.
-- http://www.deepdroid.com On Apr 16, 7:21 pm, "Yusuf T. Mobile" <yusuf.s...@t-mobile.com> wrote: > I got the same "illegal modifier for strSheikResp" error from Eclipse > when I put it inside a function, but no error when I put it inside a > class but outside of a function. > > static final String[] strSheikResp = new String[]{"open sesame"}; > > Where did you put the declaration? > > Yusuf Saib > Android > ·T· · ·Mobile· stick together > The views, opinions and statements in this email are those of the > author solely in their individual capacity, and do not necessarily > represent those of T-Mobile USA, Inc. > > On Apr 15, 4:57 pm, fadden <fad...@android.com> wrote: > > > On Apr 15, 4:37 pm, "Kevin J. Brooks" <bear123434...@comcast.net> > > wrote: > > > > I took out the key word static and fixed the problem. > > > You now have a different string array in every instance of the class, > > instead of one for all instances of the class. > > > How does Eclipse feel about: > > > static final String[] strSheikResp = {"test1", "test2"}; > > > ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---