call method from main class, gives error

Posted by user557039 on Stack Overflow See other posts from Stack Overflow or by user557039
Published on 2011-01-17T11:41:51Z Indexed on 2011/01/17 11:53 UTC
Read the original article Hit count: 156

Filed under:

try to call method ss from class from it return me error,

Blockquote Exception in thread "main" java.lang.NullPointerException at teste1.exp.ss(exp.java:16) at teste1.Main.main(Main.java:64) Java Result: 1 Blockquote

<pre>

public class Main {
   public static void main(String[] arguments) {
...................
    private static String[] ff;
    exp mega = new exp();
mega.ss(ff);

}

class exp {

 public void ss (String gvanswer[]){


    String answer[] = new String[3];

            answer[0] = "pacific ";
            answer[1] = "everest";
            answer[2] = "amazon ";

    if (gvnswer[0].equals("pacific"))
   {System.out.println("eeeeeeeeeeeeee  ");}

  if (gvanswer[1].equals(answer[1])){System.out.println("l  ");}

    }

© Stack Overflow or respective owner

Related posts about java