Velocity Reviews - Computer Hardware Reviews

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

Thread Tools

very new to java string array question

Roedy Green
Posts: n/a
On Fri, 18 Dec 2009 13:27:24 -0800 (PST), Removed) wrote,
quoted or indirectly quoted someone who said :

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

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


for the magic User-Agent strings to simulate various browsers.

Roedy Green Canadian Mind Products
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
Originally Posted by jason
hello, below is my code. the error message is:
Exception in thread "main" java.lang.NullPointerException
at WebsiteReader.main(

String MyStrArray[]= null;

while (line != null) {
line = reader.readLine();
MyStrArray[Counter]= line;

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

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