Lab8Driver - System.out.println("Object #2:\n" +

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

View Full Document Right Arrow Icon
/** * The Lab8Driver class <Driver * for Employee and SalariedEmployee * class creates objects and displays * output using toString> * @author Jeff Cox */ * import java.io.*; import java.util.Scanner; i public class Lab8Driver { public static void main (String args []) { double anualPay = 40000; String wholeName = "Jeff Cox"; String address = "509 Bay Green Dr."; SalariedEmployee firstObject = new SalariedEmployee(); SalariedEmployee secObject = new SalariedEmployee(anualPay); SalariedEmployee thirdObject = new SalariedEmployee(wholeName, address); SalariedEmployee fourthObject = new SalariedEmployee(wholeName, address, anualPay); System.out.println("Object #1:\n" + firstObject.toString());
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("Object #2:\n" + secObject.toString()); System.out.println("Object #3:\n" + thirdObject.toString()); System.out.println("Object #4:\n" + fourthObject.toString()); try { String fileName = "read.txt"; File file = new File(fileName); Scanner inputFile = new Scanner(file); //Statments can go here for if file is opened System.out.println("File Found."); inputFile.close(); } catch (FileNotFoundException e) { //Statements will execute here if file is not found System.out.println("File Not Found."); } //inputFile.close(); } }...
View Full Document

This note was uploaded on 07/28/2009 for the course CSI 161 taught by Professor Deborahpenna during the Spring '09 term at Anne Arundel CC.

Ask a homework question - tutors are online