COSC 5910.03: Lecture Contents

Winter 2002-2003

Contents and Java codes discussed in class

Week 1 [Jan 7, 2003]: An Introduction to Java (Chapter 1)
  • how to compile and execute a Java program: use of the Java compiler ("javac") and the Java interpreter ("java")
  • relevance of Java as a network language
  • estimation of pi by throwing random darts: DartPi.java

    Week 2 [Jan 14, 2003]: Objects and Primitive types (Chapter 2)
  • Primitive types and their operations
  • Data conversion (in assignment and binary operations) and casting
  • Class libraries and API; example: the Math class
  • Providing static methods in a class Gcd.java

    Week 3 [Jan 21, 2003]: Introduction to Classes (Chapters 3 and 4)
  • program control flow: if and while statements
  • Classes and objects; pre-defined classes and API
  • use of String class StringEg.java
  • use of BigInteger class BigFactorial.java
  • methods: how to invoke methods, static and instance methods
  • signature and method overloading

    Week 4 [Jan 28, 2003]: More on Using Classes (Chapter 3)
  • The Stock class in type.lib: fields, constructors, methods.
  • Accessor, mutator, standard and specialized methods.
  • use of Stock class StockEg.java
  • How to read data from keyboard and from files ReadData.html

    Week 5 [Feb 3, 2003]: Writing Classes (Chap 4: 4.0-4.5 and Chap 5: 5.1, 5.2)
  • Anatomy of a class; anatomy of methods.
  • A class example: Die.java
  • An example of using the Die class: DieStats.java
  • Another class example: Card.java
  • An example of using the Card class: CardTester.java

    Week 6 [Feb 11, 2003]: Array of Objects and URL readers (Chap 6: 6.0-6.3)
  • arrays of primitive types and of objects
  • An example of using an array of String objects: ArrayOfStrings.java
  • An example of array of Cards: CardDeck.java and CardDeckTester.java
  • URL reader using java.io: an example URLReader.java
  • URL reader using type.lib.UniReader: an example URLUniReader.java
  • Using type.lib.UniReader to retrieve stock quotes from TSE: TseStockQuote.java
  • An example of using the StringTokenizer class: TokenizerTest.java

    Week 7 [Feb 18, 2003]: Test 1 on Feb 18, 2003
  • Test 1 on Feb 18, 2003

    Week 8 [Feb 25, 2003]: Reading Week
  • Reading Week

    Week 9 [Mar 4, 2003]: Inheritance & Polymorphism (Chapter 7: 7.0-7.4)
  • An example of subclass: ColorDie is a subclass of the Die class ColorDie.java
  • Another example of subclass: LoadedDie is a subclass of the Die class LoadedDie.java
  • Abstract classes.
  • Example of abstract classes in Assignment 3: Stock, TseStock and UsStock classes.

    Week 10 [Mar 11, 2003]: Interface (Sect 5.5) & GUI applications (Sect 5.7)
  • Base class: a Person class example Person.java, and its partial api in Person.html.
  • Subclass: an Actor class example Actor.java, and its partial api in Actor.html.
  • A tester code for Person/Actor classes: ActorTester.java.
  • Interface. Examples: Comparable, ActionListener
  • Graphical User Interface: components, events, listeners.
  • An GUI example: TemperatureConverter.java.

    Week 11 [Mar 18, 2003]: Polymorphism & Interface (Sect 7.5), Exception Handling (Sect 8.0)
  • Use of Polymorphism via interfaces. An example: InsertionSort.java and InsertionSortTest.java.
  • An example to illustrate exception from UniReader: PrintFile0.java, and the handling of the exception PrintFile.java.
  • An example to illustrate multiple exceptions: ConvertDate.java.
  • An example to illustrate the handling of multiple exceptions by try/catch: DateTryCatch.java.

    Week 12 [Mar 25, 2003]: Checked/Unchecked Exceptions, Vector & Iterator
  • An example to illustrate checked exceptions (FileNotFoundException and IOException): PrintFileByBufferedReader0.java and PrintFileByBufferedReader.java .
  • An example to illustrate vector (a self-expandable array) IntVector.java, and IntVectorTester.java.
  • An example to illustrate the use of java.util.Vector class (which implements the Collection interface) and iterators VectorTester.java,
  • An example to illustrate the use of java.util.HashSet class (which implements the Collection interface) HashSetTester.java,

    Last Updated: 03/16/2003