This course [Java 面向对象程序设计] enables a student with little previous knowledge about programming to write programs in a productive environment using the Java programming language. This involves developing two sets of skills: A programmer must understand the programming language itself, its underlying paradigms, its utilities, syntax, and how to translate the specification of a task into program code. Since software is often developed in a team, a programmer also needs to know the basic tools predominantly used in the ecosystem centered around the programming language. She must not only know how to structure her code for maximum reuse and minimum maintenance requirements, but also how to use and create libraries, as well as how debug and document code. Our course tries to address both requirements in an integrated fashion.
This course has been designed by Prof. Weise from scratch. It does not just try to teach programming in a practical way, using many fully functional examples. It also introduces the tools that are needed to become an effective software engineer (and which usually are entirely ignored in academic courses) at didactically suitable points.
Prerequisites: None
Goals:
- Attain basic programming skills, including
- assignments, expressions, conditionals, loops, functions
- object-oriented programming, class hierarchies, inheritance, interfaces, encapsulation
- exception handling
- basic Java utilities such as collections and streams
- Learn how to use the most important tools for productive software development, including
Teacher: Prof. Dr. Thomas Weise
Course Material
As course material, a comprehensive set of slides and examples is provided. Each course unit targets one closed topic, only building on previously introduced topics, and provides a wide set of examples. Each example is a complete compile- and executable Java program. Each example is focused on exactly one phenomenon.
A tar.xz archive with all the teaching material (slides, examples, homework) of this course can be found here.
- Introduction
- Java
- Eclipse
- Types, Variables, and Assignments
- Operators and Expressions
- Console I/O
- Conditionals (
if
-then
-else,
switch
-case
) - Loops (
for
,while
,do
)
- Arrays
static
Methods- Command-Line Arguments
static
Variables- Debugging
- Objects, Instance Variables, and
new
- Instance Methods
- Inheritance and Overriding
- Packages and
import
- Visibility, Encapsulation,
final
, and Inner Classes
- Documentation with Javadoc
- Type Casts
- Generics
- Collections,
equals
, andhashCode
abstract
Classes- Interfaces
- Exceptions
- Libraries and Executables
- Testing with JUnit
- I/O and Streams
- Autoboxing
- Building with Maven
Practical Homework
The homework in this class is always a mixture of practical lab tasks combined with questions about the understanding of the topics. The homework follows two goals: On one hand, we want to build the basic ability to create computer programs with Java. On the other hand, we also want to sensitize the students for phenomena, border cases, and common errors in the corresponding topic. Training the ability to discover and fix errors will automatically train the abilities to solve problems and to write clean code.