Class AssertDemoApp

java.lang.Object
  |
  +--AssertDemoApp

public class AssertDemoApp
extends java.lang.Object

AssertDemoApp.java Created: Fri Jan 10 16:01:40 2003

Author:
Stuart C. Shapiro Demonstrates the usefulness of Java assertions and exceptions.

Constructor Summary
AssertDemoApp()
           
 
Method Summary
static void CheckPhoneNumber(java.lang.String n)
          Prints n, formatted as a 10-digit phone number, with the comment that it is a possible phone number.
static void main(java.lang.String[] args)
          Driver for AssertDemoApp, demonstrating a failed assertion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssertDemoApp

public AssertDemoApp()
Method Detail

CheckPhoneNumber

public static void CheckPhoneNumber(java.lang.String n)
Prints n, formatted as a 10-digit phone number, with the comment that it is a possible phone number.

pre: n.length == 10.

post: n is printed as a 10-digit phone number, formatted as a phone number, with the comment that it is a possible phone number.

Parameters:
n - a 10-digit String.

main

public static void main(java.lang.String[] args)
Driver for AssertDemoApp, demonstrating a failed assertion.