Examples
File I/O
(text, UTF-8):
UTF8FileInputDemo.java
UTF8FileOutputDemo.java
UTF8
CopyFile
.java
FileUtils.java
(static methods for opening PrintWriter and BufferedReader objects)
UTF8CopyFile2.java
(uses methods in FileUtils)
Experiment.java
(another example for the use of FileUtils (from the course meeting January 24th))
Inheritance, Polymorphism, and Dynamic Binding
:
Demo program:
PeopleDemo.java
Base class:
Person.java
Derived class:
Student.java
Defining Equals Methods
:
In a base class:
Parent.java
In a derived class:
Child.java
Array (used as instance variable):
StringList.java
StringListDemo.java
Constructors:
Pet.java
PetDemo.java
BankAcct1.java
BankAcct1Demo.java
BankAcct1Test.java
Class definitions:
Class definition template:
ClassDefTemplate.java
Identify parts of a class:
Car1Example
Source code for the Car class:
Car1.java
Car1Demo.java
Loops:
WhileWithScanner.java