Replace: String[] wordList = {

 
"American","American","Brown","Christian","Congress","Doctor","England","English"
       };

with: this.wordList = new String[]{

 
"American","American","Brown","Christian","Congress","Doctor","England","English"
       };

On Apr 1, 12:24 pm, trans <[email protected]> wrote:
> I don't really get Java. I'm trying to define a public array member,
> like so:
>
>   public class MyClass {
>
>     // alphabetical list of words
>     private String[] wordList;
>
>     // constructor
>     public MyClass() {
>
>       String[] wordList = {
>
> "American","American","Brown","Christian","Congress","Doctor","England","English"
>       };
>
>     }
>
>     public String[] getList() {
>       return wordList;
>     }
>
>   }
>
> When I try to access wordList, as in getList(), I get a null error.
> Why?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
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/android-developers?hl=en

Reply via email to