See first example here : Scanner
If you want to query the user for input, you'll have to read from System.in (do it with a Scanner or the like).
Like this ...
Scanner fromUser = new Scanner(System.in);
try (DataOutputStream dos = new DataOutputStream(s1.getOutputStream())) {
System.out.println("Enter the item id that you want:\n");
id = fromUser.nextInt();
dos.writeInt(id);
System.out.println("Enter the amount of item that you want:\n");
amt = fromUser.nextInt();
dos.writeInt(amt);
dos.flush();
}
Of course, there are more ways to achieve the same goal. That's just one ...