import java.util.*; public class TerminalClient{ public static void main(String [] args){ // declare and construct a scanner from STANDARD INPUT (ie, the terminal!) Scanner scanKeyboard = new Scanner(System.in); System.out.printf("\nEnter filename: "); String fileName = scanKeyboard.next(); System.out.printf("\nOk, you gave me <%s> for a filename. Thanks.\n\n", fileName); // to be really correct we should take care of properly closing the connection scanKeyboard.close(); } }