title: Java Split() function giving Null pointer Exception error
body: <pre><code>public class url {
  
  
   public static void main(String[] args) throws Exception {
  
      URL imdb = new URL("http://www.omdbapi.com/?t=The%20incredible%20Hulk");
  
      URLConnection yc = imdb.openConnection();
  
      BufferedReader in = new BufferedReader(new InputStreamReader(
                                  yc.getInputStream()));
      String inputLine;
  
      while ((inputLine = in.readLine()) != null) 
          System.out.println(inputLine);
  
      String[] strarr = inputLine.split(",");
  
  
      System.out.println("splits.size: " + strarr.length);
  
      in.close();
  }
  }
  </code></pre>
  
  <p>The Error is : 
      "Exception in thread "main" java.lang.NullPointerException
      at imdb.url.main(url.java:25)"</p>
  
  <p>Please explain to me to how I can remove it.  I have googled a lot on using split function and null pointer exception, but just can't understand what I'm doing wrong. </p>