Java
Course
Here are some (Hebrew) lecture
notes for a crash course on the Java Programming Language I once gave. In some
places they are complete and in other places they are only sketches of what I
actually taught. They are in Hebrew MS-Word 97 format. This course was intended
for people with some programming background.
Course Outline:
- What is Java?
- Motivation for creating the Java
Programming Language.
- The way we write programs in the Java
envirnment (as contrasted
with C - compiling to byte-code instead of machine-code, dynamic linking)
- Advantages of Java over C/C++.
- Our first and second Java program.
- Very short introduction to OOP.
- What is a class and what is an object
(example: class - Nokia 6120 ,
object - my specific cell phone).
- A program as a collection of
interacting objects (Example: a calculator).
- Objects in Java
- Java objects. Pointers to objects.
Fields and methods.
- Constructors.
- Example: importance of encapsulation
for flexibility of implementation.
Private and public access modifiers.
- Maintaining correctness conditions
(invariants) of objects using constructors
and access modifiers.
- Interfaces
- Interfaces in the real world (two
different kinds of earphones can plug in
to the same WalkMan).
- Interfaces in Java.
- Breaking a program into components
using interfaces. Calculator example.
- Extension (inheritence)
- Example of code duplication and how
extension avoids it.
- Constructors.
- super keyword.
- Differences between extension and
interfaces.
- How an extended object looks in
memory.
- The class Object.
- Advanced use of extension
- Using abstract classes and interfaces
to plug-in different codes into the
same frame work (menu example).
- An example from the Java library: the
Servlet API
- Exceptions
- Problems with error handling in C.
- Exceptions as "alarms"
- Exceptions are part of the function's
definition.
- Runtime exceptions.
- The finally keyword.
- Some Java features:
- packages
- static members
- overloading (important: depends on the
argument's declared type and
not its actual type)
- Nested (inner) classes (only static).
- The Java API
- java.lang
- java.util - Data Structures -
Collections and Maps
- java.io - stream based input and
output (Example: makezip)
- Serialization
- Threads and Networking
- Threads in Java
- Waiting, Deadlocks, etc.
- TCP Networking in Java - as easy as
using the phone Examples: email sender,
echo server, chat server.
Home
| Academic work | Courses | Links