Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.DataInputStream;
import java.net.Socket;

public class Main {
    public static void main(String[] args) throws Exception {
        Socket sock = new Socket(args[0], 1234);
        DataInputStream dis = new DataInputStream(sock.getInputStream());
        float f = dis.readFloat();
        System.out.println("PI=" + f);
        dis.close();
        sock.close();
    }
}