ideas/SimpleClient.java
public static void main(String[] args) {
		// splash banner
    System.out.println( "\n*********************************" );
    System.out.println( "SimpleClient" );
    System.out.println( "*********************************\n" );
		// new instance of SimpleClient
		SimpleClient client = new SimpleClient();
		// create command line Scanner object
		Scanner stdin = new Scanner( System.in );
		// get the server address from the command line
		System.out.print("Server address: ");
		client.setServerAddress( stdin.nextLine() );
		// get the server port from the command line
		System.out.print("Server port: ");
		// try to understand the port number
		try {
			client.setServerPort( Integer.parseInt(stdin.nextLine()) );
		} catch (Exception e) {
			System.out.println("Didn't understand that port number!\nConnecting to port "+client.getServerPort()+" instead.");
		}
		// connect to the server
		client.connect();
	}
// This main method allows this class to be run stand-alone (e.g. for testing)

This main method allows this class to be run stand-alone
This main method allows this class to be run stand - alone
public static void main(String[] args) {
    System.out.println( "\n*********************************" );
    System.out.println( "SimpleClient" );
    System.out.println( "*********************************\n" );
		SimpleClient client = new SimpleClient();
		Scanner stdin = new Scanner( System.in );
		System.out.print("Server address: ");
		client.setServerAddress( stdin.nextLine() );
		System.out.print("Server port: ");
		try {
			client.setServerPort( Integer.parseInt(stdin.nextLine()) );
		} catch (Exception e) {
			System.out.println("Didn't understand that port number!\nConnecting to port "+client.getServerPort()+" instead.");
		}
		client.connect();
	}
public static void main ( String [ ] args ) { System . out . println ( "\n*********************************" ) ; System . out . println ( "SimpleClient" ) ; System . out . println ( "*********************************\n" ) ; SimpleClient client = new SimpleClient ( ) ; Scanner stdin = new Scanner ( System . in ) ; System . out . print ( "Server address: " ) ; client . setServerAddress ( stdin . nextLine ( ) ) ; System . out . print ( "Server port: " ) ; try { client . setServerPort ( Integer . parseInt ( stdin . nextLine ( ) ) ) ; } catch ( Exception e ) { System . out . println ( "Didn't understand that port number!\nConnecting to port " + client . getServerPort ( ) + " instead." ) ; } client . connect ( ) ; }
This main method allows this class to be run stand-alone (e.g.
This main method allows this class to be run stand - alone ( e . g .
// splash banner
 // new instance of SimpleClient
 // create command line Scanner object
 // get the server address from the command line
 // get the server port from the command line
 // try to understand the port number
 // connect to the server
