Class BugDemoApp

java.lang.Object
  |
  +--BugDemoApp

public class BugDemoApp
extends java.lang.Object

BugDemoApp.java Created: Sat Jan 11, 2003

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

Constructor Summary
BugDemoApp()
           
 
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 BugDemoApp, demonstrating a bug due to a failed precondition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BugDemoApp

public BugDemoApp()
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 BugDemoApp, demonstrating a bug due to a failed precondition.