example
Class LeapYear

java.lang.Object
  extended by example.LeapYear

public class LeapYear
extends java.lang.Object

A very simple example how to use ComTest as a definition and testing tool. In this first example we test simple function.

Version:
8.6.2010
Author:
vesal

Constructor Summary
LeapYear()
           
 
Method Summary
static boolean isLeapYear(int year)
          Check if year is a leap year.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeapYear

public LeapYear()
Method Detail

isLeapYear

public static final boolean isLeapYear(int year)
Check if year is a leap year. Year is a leap year if it is divisible by 4. Unless it is divisible by 100. But years divisible by 400 are leap years. (maybe year 4000 will not be?)

Parameters:
year - to check
Returns:
true if is a leap year, otherwise false
Example:
   isLeapYear(1900) === false
   isLeapYear(2000) === true  
   isLeapYear(2003) === false
   isLeapYear(2004) === true
   isLeapYear(2010) === false   
 

main

public static void main(java.lang.String[] args)
Parameters:
args - not used