Most of the applications written these days require some or the other network feature. Stand-alone Java applications are rare occurence these days. In order to write a Java program which reads a Webpage, follow the steps mentioned below.
1.) Instantiate a URL object by passing the URL string to its constructor. [Line 16 in the code below]
2.) Retrieve a URLConnection object . [ Line 17 in the code below]
3.) Get an input stream from the connection. [Line 18-20 in the code below]
4.) Create a BufferedReader on the input stream and read from it. [Line 23-25 in the code below]
In the code mentioned below, i have tried reading http://technofriends.in