Java Application skeleton


by Ron Zucker

The following is the skeleton for a Java Application. The key to the skeleton is:

/** ... */ is a multiline comment used by javadoc

/* ... */ is a multiline comment

// is a single line comment

italics indicate user supplied names

bold italics indicate Java types or modifiers

[] indicate optional fields

 

See also: Java Standards link elsewhere nearby.


 
// let Java know which packages are to be used in this application...
import package.name.*;
 
/**
 *   Brief description of Application
 *   @author  authors name
 */
 
// declare the Application name (it must be the same as the filename
// and is case sensitive)
public class ApplName
{
  // define "global" variables here (global to this class), if any
  [modifier] type var1[,var2,var3];
 
 
  /**
   *    brief description of method
   *    @return  description of the returned value if any
   *    @param   description of the parameters passed
   */
   // define methods, if any (methods are like functions)
   [modifier] returntype methodname ([type arg1,[type arg2,...])
   {
     // define "local" variables here (local to this method), if any
     [modifier] type var1[,var2,var3];
 
     // insert Java code here
   }
 
 
   /**
    *   brief description of the main application
    */
   // this is the main method and must be defined as follows         
   public static void main(String[] args)
         [throws exceptionclass]
   {
     // define "local" variables here (local to this method), if any
     [modifier] type var1[,var2,var3];
 
     //  insert Java Main code here
   }
}

Additions, corrections, comments please email to rzucker@unf.edu(click to send mail)