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[] args) throws Exception {
        InetAddress addr;
        Socket sock = new Socket(args[0], 80);
        addr = sock.getInetAddress();
        System.out.println("Connected to " + addr);
        sock.close();
    }
}