View RSS Feed

Java Socket

Socket programming and networking examples in Java.

  1. Java Networking: URL + URLConnection

    by , 04-25-2012 at 11:31 PM
    Two classes are present in package. URLConnection class & URL class.Client connections are created by these classes to the web servers. Here is a code given as an example:
    Java Code:
    URL url = new URL("");
    URLConnection urlConnection = url.openConnection();
    InputStream input = urlConnection.getInputStream();
    int data =;
    while(data != -1){
        System.out.print((char) data);
        data =