102. Introduction to Java
Programming
Rev. 5.0
Java is a popular and powerful language. Although comparatively
simple in its language structure, there are a number of subtleties that can
trip up less experienced programmers. It is based on C, and the terse nature of
C may be unfamiliar to students with some previous experience programming in languages
such as COBOL or Visual Basic who do not have experience with C or C++. And, of
course, Java is object-oriented.
The five-day timeline of this course explicitly targets less
experienced programmers, providing them with a thorough step-by-step
introduction to Java programming. It lays a firm foundation for further study
of Java. There are a large number of example programs and many labs. The course
software also includes an optional overlay of workspace and project files to
support use of the Eclipse IDE in the classroom. (This requires that the instructor be
experienced in use of Eclipse and able to walk students through basic tasks in
the IDE.)
An important thrust of this course is to teach programming from an
object-oriented perspective. It is often difficult for programmers trained
originally in a procedural language to start “thinking in objects.” This course
introduces object-oriented concepts very early, and Java is developed in a way
that leverages its object orientation. Most of the course emphasizes simple
classes without inheritance. The last chapter introduces inheritance and
polymorphism, along with interfaces and collections.
This revision of the course targets the 5.0 version of the Java
language and Core API. (Java 5.0 is also
known as Java 1.5, as this revision effects a transition to a new numbering
scheme for the Java environment.) It has
been rebuilt thoroughly, not only to cover new 5.0 language features, but also
to comb out old programming techniques in favor of new ones. For training within the Java 1.4 environment,
please see version 1.4.1 of this course.
LEARNING OBJECTIVES
·
Learn the basic principles of object-oriented
programming
·
Learn the essentials of the Java programming
language
·
Acquire the skills needed to design, code and
debug computer programs in the Java language
Course Duration: 5
days
Prerequisites: Good
general problem solving skills. Some previous experience programming in a
procedural language is essential.
1.
What is Java?
Object Orientation
Java Language
Java Virtual Machine
Java Libraries
World Wide Web and Java
Java Platforms
Java as a First Programming Language
2.
First Java Programs
Hello, World
Program Structure
Output in Java
Variables and Expressions
Calculations Using Java
3.
Introduction to Objects
Object Models
Classes and Objects
State and Behavior
Input in Java
InputWrapper Class
Packages
4.
Data Types and Operators
Strong Typing
Integer Data Types
Floating Point
Conversions Between Types
Arithmetic Operators
Doing Math in Java
Precedence
Errors in Integer Arithmetic
5.
Booleans and Enumerations
Boolean Variables
Logical and Relational Operators
If Tests
Compound Statements
Switch Statement
Enumerated Types
6.
Loops and Program Flow
While Loops
Quitting Infinite Loops
Curly Braces and Indenting
Sentinels and Counters
For Loops
Loops and If Tests Together
Nested If Statements
7.
Objects and Classes
Structured Data
Classes
References
Instantiating an Object
Assignment of Objects
Initialization
Garbage Collection
Methods
Public vs. Private
Encapsulation
Constructors
Formatted Output
8.
Characters and Strings
Char Data Type
Character Codes
ASCII and Unicode
String Class
String Input and Output
String Methods
9.
Modular Programming
Monolithic Programs
Static Variables and Methods
Functional Modularity
Object Modularity
Top-Down and Bottom-Up Development
Pass-By-Value and Pass-By-Reference
Nested Classes
10. Arrays
One Dimensional Arrays
Subscripts
Initializing Arrays
Arrays and the For-Each Loop
Copy and Assignment
Arrays of Objects
Multidimensional Arrays
Searching
11. Bit
Operations
Bitwise Operators
Truth Tables
Hexadecimal Notation
Shifting and Masking
12. Exception
Handling and More Flow Control
Exceptions
Errors in Integer Arithmetic
Floating Point Operaations
I/O Exceptions vs. Runtime Exceptions
Named Exceptions
Exception Methods
Break
Continue
Do
13. Advanced
Java Features
Reusable Software Components
Abstraction
Inheritance
Inheritance Hierarchies
Polymorphism
Abstract Classes
Interfaces
Collections
Iterators
Auto-Boxing
Appendix A. Learning Resources
System Requirements
Hardware – minimal: Pentium 500MHz, 128 meg RAM, 500 meg HD.
Hardware – recommended: Pentium 1.5gHz, 512 meg RAM, 1
gig HD.
Operating system: Tested on Windows XP Professional. The course software should be viable on all
Windows or Linux systems which support J2SE 5.0.
Software: All free downloadable tools.