example
Class LeapYearReady

java.lang.Object
  extended by example.LeapYearReady

public class LeapYearReady
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
LeapYearReady()
           
 
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

LeapYearReady

public LeapYearReady()
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; // divisible by 100
   isLeapYear(2000) === true;  // divisible by 400
   isLeapYear(2003) === false; // odd number
   isLeapYear(2004) === true;  // divisible by 4
   isLeapYear(2010) === false; // not divisible by 4
 

main

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