public class Echo {
public static void main (String[] args) {
for (String s: args) {
System.out.println(s);
Socket socket;
socket = new Socket(s, 16789);
}
}
}
Note that this code would parse multiple command line arguments. If you only have one you can use args[0]
and get rid of the for
loop.