NameAge.java


Below is the syntax highlighted version of NameAge.java.


 /***********************************************************************
  *   Name:     Kevin Wayne
  *   Login:    wayne
  *   Precept:  P05
  *
  *   Inputs 2 command line arguments.  Outputs sentence using them.
  *   Example of difference between print() and println().
  *
  *   Compilation: javac NameAge.java
  *   Execution:   java NameAge name age
  *
  *   > java NameAge Alice 19
  *   Alice is 19 years old.
  *
  ***********************************************************************/
  public class NameAge {
      public static void main(String[] args) {
         
          System.out.print(args[0]);
          System.out.print(" is ");
          System.out.print(args[1]);
          System.out.println(" years old.");

      }
  }