Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > very new to java string array question

Reply
Thread Tools

very new to java string array question

 
 
Roedy Green
Guest
Posts: n/a
 
      12-20-2009
On Fri, 18 Dec 2009 13:27:24 -0800 (PST), http://www.velocityreviews.com/forums/(E-Mail Removed) wrote,
quoted or indirectly quoted someone who said :

>URLConnection connection = url.openConnection();
>connection.setRequestProperty("User-Agent", "Mozilla/4.1... bla bla
>bla"


The HTTP class is what I use for Web scraping. It fakes in the latest
Firefox as the user agent by default.

See http://mindprod.com/products1.html#HTTP

See http://mindprod.com/jgloss/http.html
for the magic User-Agent strings to simulate various browsers.

--
Roedy Green Canadian Mind Products
http://mindprod.com
The future has already happened, it just isnít evenly distributed.
~ William Gibson (born: 1948-03-17 age: 61)
 
Reply With Quote
 
 
 
 
code learner code learner is offline
Junior Member
Join Date: Dec 2010
Posts: 19
 
      01-09-2011
Quote:
Originally Posted by jason
hello, below is my code. the error message is:
Exception in thread "main" java.lang.NullPointerException
at WebsiteReader.main(WebsiteReader.java:23)

String MyStrArray[]= null;


while (line != null) {
System.out.println(line);
System.out.println(String.valueOf(line));
line = reader.readLine();
MyStrArray[Counter]= line;

Counter=Counter+1;
}
}
MyStrArray[Counter]= line;
the above line throws NullPointerException
because of
String MyStrArray[]= null;
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Very very very basic question Peter C Programming 14 02-14-2005 09:46 AM
very very very long integer shanx__=|;- C Programming 19 10-19-2004 03:55 PM
very very very long integer Abhishek Jha C Programming 4 10-17-2004 08:19 AM
Quick Book file access very very very slow Thomas Reed Computer Support 7 04-09-2004 08:09 PM
very Very VERY dumb Question About The new Set( ) 's Raymond Arthur St. Marie II of III Python 4 07-27-2003 12:09 AM



Advertisments