Course Outline for Computer Science 19A
Object-Oriented Programming Methods in Java
Effective: Fall 2006
SLO Rev: 05/19/2016
SLO Rev: 05/19/2016
Catalog Description:
CSCI 19A - Object-Oriented Programming Methods in Java
4.00 Units
Object-oriented programming methods employed to design, program, test and document intermediate level problems in the Java language. Overview of Java syntax, control structures, methods, I/O, strings, single and multidimensional arrays, recursion and exception handling. Abstract Data Types and Object-Oriented Programming principles including classes, information hiding, aggregation, inheritance, method overriding and polymorphism. Introduction to graphical user interfaces (GUIs) and applets using the javax.swing package. Dynamic allocation and de-allocation of memory; comparison of Java references with pointers in C++. Implementation and use of linked lists. Designed to satisfy Association of Computing Machinery (ACM) guidelines for CSI as required for Computer Science and related transfer majors.
Strongly Recommended: CSCI 14 and MTH 20.
Course Grading: Optional
| Type | Units | Inside of Class Hours | Outside of Class Hours | Total Student Learning Hours |
|---|---|---|---|---|
| Lecture | 3.00 | 54.00 | 108.00 | 162.00 |
| Activity | 0.00 | 0.00 | 0.00 | 0.00 |
| Laboratory | 1.00 | 54.00 | 0.00 | 54.00 |
| Clinical | 0.00 | 0.00 | 0.00 | 0.00 |
| Work Exp (Non-Paid) | 0.00 | 0.00 | 0.00 | 0.00 |
| Work Exp (Paid) | 0.00 | 0.00 | 0.00 | 0.00 |
| Total | 4.00 | 108.00 | 108.00 | 216.00 |
Measurable Objectives:
Upon completion of this course, the student should be able to:
- create, design, implement, debug, test, and document eight to ten Java applications and applets of intermediate length and complexity that use the full range of Java syntax, selected Java classes, user-defined classes (including those that use the various class associations), and standard GUI components, including at least one simple graphical user interface that can respond to events, using the Java development kit (SDK) and an other integrated development environments (IDE) such as JBuilder or Eclipse
- use various Java core classes including String, System, Math, and wrapper classes to perform standard System input and output, perform numeric calculations and instantiate and manipulate objects of both Java and user-defined classes
- manipulate String and StringBuffer objects, arrays consisting of simple or reference type
- design Java classes that use visibility modifiers and class (static) variables, overloaded constructors, accessor and mutator methods
- design classes and create and use objects of these classes that bear the following relationships: association (“knows a”), aggregation (“has a”), and inheritance (“is a”)
- write program incorporating basic exception handling techniques: try-catch and throw
- create and implement an interface
- extend an abstract base class and explain the difference between abstract and concrete classes
- design and code a linked list class “from scratch”
- demonstrate familiarity with dynamic memory allocation (“new”) and de-allocation (garbage collection)
Course Content:
- Java Environment
- Using a SDK and selected Integrated Development Environments to edit, compile, debug, and execute a Java application
- Using the SDK and selected Integrated Development Environments to edit and compile a Java applet and its associated HTML file
- Using a Web browser and AppletViewer to execute an applet
- JAVA Syntax
- Primitive data types for variables and constants (final)
- Operators
- System input and output – conversion of input to numbers
- Selection and Repetition control structures
- Methods: definition, calling, return types, parameters, call by value, overloaded methods
- Simple recursive methods
- Math class methods
- Objects and Classes
- Defining a class
- Visibility modifiers
- Scope of variables
- Class (static) variables and methods
- Constructors: definition/significance/use of
- Types of constructors: default. parameterized, copy (optional)
- Declaring object references and object instantiation
- Accessor and mutator methods
- Passing objects to methods
- The keyword this
- Class relationships: association, aggregation, composition, and inheritance
- Use of wrapper classes
- Inheritance
- Superclasses and subclasses
- Use of the keyword super in relations to methods and constructors
- Overriding methods
- Abstract classes
- Methods of the Object class: equals(), toString(), clone (optional)
- Polymorphism and dynamic binding
- Interfaces
- Casting rules for reference variables
- Inner and Nested classes
- Designing projects
- Use of Unified Modeling Language for class diagrams
- Guidelines for class design
- Strings and StringBuffers
- String class
- Constructing a string object
- Common methods
- Substrings
- Accessing individual characters
- StringBuffer class
- Comparison with String class
- Common methods
- String class
- StringTokenizer Class
- Comparison of Java references and C++ pointers
- Memory Allocation:
- dynamic memory allocation (for arrays and objects)
- dynamic memory allocation (garbage collection)
- Arrays and linked lists
- Declaring, creating and initializing one-dimensional and two-dimensional arrays
- Typical array operations: accessing elements, simple sort and sequential search
- Arrays of objects, arrays of arrays
- Introduction to the ArrayList and LinkedList classes
- Iterators
- Creating a linked list class “from scratch”
- Application parameters
- Graphics
- The Java Graphics API (Application Program Interface)
- Color class
- Drawing geometric figures (drawLine(), drawOval(), drawRect(), drawPolygon())
- Introduction to user interfaces
- The jara.awt and javax.swing packages
- Frames, applets, containers, components, panels, layout managers
- GUI components: text boxes, labels, scroll bars, sliders, buttons, check boxes, radio buttons
- Event driven programming: listeners and event handlers
- Exception handling
- Definition
- Java predefined exception classes
- User-defined exceptions
- Claiming an exception: use of throw
- Handling an exception: try-catch block
Methods of Instruction:
- Demonstration/Exercise
- Laboratory
- Lecture/Discussion
- Distance Education
Assignments and Methods of Evaluating Student Progress:
1. Typical Assignments
- Construct a Vehicle class. A vehicle has a VIN (Vehicle ID number), year of manufacture, original MSRP, and current blue book value. In each derived class include Strings to store the make and model. Include a reference variable of type Person that represents the vehicle’s owner. For simplicity, assume a Vehicle has only one owner. A new vehicle’s owner is represented by the person reference being null. Construct the usual constructors, and accessor methods, and override the toString method. Supply any other useful methods you desire.
- First do problem 9.24 on p.452 which is an extension of your inheritance Shape program. In this project, you will actually draw several 2-D figures. You can choose which ones you wish to draw. You can draw rectangle, circle, oval, square using specific methods that belong to all Graphics objects. To draw a triangle, you will have to draw lines to form the sides.
2. Methods of Evaluating Student Progress
- Minimum of two midterms (or equivalent) and a final exam
- Writing and implementation of various and multiple assigned programs and other assignments which utilize all topics included in the course of study
3. Student Learning Outcomes
Upon the completion of this course, the student should be able to:
- construct a class hierarchy
- demonstrate steps involved in program development
- Produce well-documented, user-friendly programs of short to medium length
- Write program incorporating basic exception handling technique: try-catch and throw
Textbooks (Typical):
- Lewis and Loftus (2005). Java Software Solutions Prentice Hall.
Additional Materials:
- Removable storage media such as USB Flash drives or floppy diskettes
Abbreviated Class Schedule Description:
Strongly Recommended: CSCI 14 and MTH 20.
Discipline:
Computer Science*
