TestAccounts1 - System.out.println("How many...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//********************************************** // TestAccounts1 // A simple program to test the numAccts method of the // Account class. //********************************************** import java.util.Scanner; public class TestAccounts1 { public static void main(String[] args) { Account testAcct; Scanner scan = new Scanner(System.in);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: System.out.println("How many accounts would you like to create?"); int num = scan.nextInt(); for (int i=1; i<=num; i++) { testAcct = new Account(100, "Name" + i); System.out.println("\nCreated account " + testAcct); System.out.println("Now there are " + Account.getNumAccounts() + " accounts"); } } }...
View Full Document

This note was uploaded on 03/22/2010 for the course CS 202 taught by Professor Fong during the Spring '10 term at SIU Carbondale.

Ask a homework question - tutors are online