Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.InputStream;
import java.net.Socket;

public class Main {
    public static void main(String args[]) throws Exception {
        Socket s = new Socket(args[0], 13);
        InputStream is = s.getInputStream();
        while (true) {
            byte b[] = new byte[100];
            int i = is.read(b);
            if (i == -1)
                break;
            System.out.print(new String(b, 0, i));
        }
    }
}