Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.net.InetAddress;
import java.net.Socket;

public class Main {
    public static void main(String[] argv) throws Exception {
        InetAddress addr = InetAddress.getByName("java.sun.com");
        int port = 80;

        Socket socket = new Socket(addr, port, InetAddress.getByName("java2s.com"), port);
    }
}