import java.net.*;
import java.io.*;

public class MojUDPClient {

  public static void main(String args[]) {

    DatagramSocket ds;
    DatagramPacket dp;

    String vrstica = "Hello world!";
    String hostname = "localhost";
    int port = 4444;

    try {
      ds = new DatagramSocket();
      dp = new DatagramPacket(
        vrstica.getBytes(), vrstica.length(), InetAddress.getByName(hostname), port);
      ds.send(dp);
    } catch (Exception e) {
      e.printStackTrace();
    }

  }
}
