The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
March 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

initialization of array reqd

Posted by tejinder singh on March 05, 2001 at 12:40 PM


dear yooklid
the reason for the null pointer exception is that your array has not been created i.e you have only created a referece to an array of type String but not bound it to any array object using new.try like this
String hosts[]=new String[10];
and then store Strings in it and it will work.



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us