Java Programming

Location: Room 223A, 德田館
Time: 0930 ~ 1230, Saturday and Sunday


``Java is C++ without the guns, knives, and clubs.''
-- James Gosling, co-inventor of Java (1955-)

Goal

This course is designed for the students who want to learn Java without any programming experiences before. We will start with the very beginning of program design and fundamental concepts about programs and machines. You are expected to be capable to implement your idea in Java independently after 30 hours of lectures. Furthermore, I wish you could learn other programming languages without suffering from starting over.

Prerequisites

Text

References

Java (introductory level)

Java (advanced level)

Data structures and algorithms

Object-oriented analysis and design (OOAD)

Related courses

Misc

Additional reading

IDE

Wifi Connection

Overview

Procedural programming

Object-oriented programming

Applications

Data structures and algorithms

Schedule [ 247, 250, 251, 252, 253, 254, 255, 260, 261, 263, 265, 266, 268, 269, 271, 274 ]

Date Key points and memo Sample code
2016.8.13 (2.5 hrs) program, algorithms, programming languages, binary system, variables, data types (int); HelloJava.java;
2016.8.14 (2.5 hrs) data types (double, char, boolean), type conversion, arithmetic/rational/logical operators, selections (if-else, switch-case, ?: operator), loops (while); ComputeArea.java, NumericalErrorDemo.java;
2016.8.20 loops (do-while, for), nested loops; RandomIntegerDemo.java, Summation.java, MonteCarloDemo.java, BisectionDemo.java, IsPrimeDemo.java, CompoundingDemo.java, MulTableDemo.java, PrintStarsDemo.java;
2016.8.21 analysis of algorithms, arrays, for-each loops, sorting algorithms, searching algorithms; ArrayDemo.java, RedrawSchemeDemo.java;
2016.8.27 methods, call stack, variable scope, method overloading, recursion, classes & objects, fields and methods, encapsulation, constructors, this operator; MaxDemo.java, MathGradeHistogramDemo.java, PrintStarsDemo2.java, FactorialDemo.java, FibDemo.java, RPGDemo.java;
2016.8.28 static members, HAS-A relationship (aggregation and composition), IS-A relationship, inheritance, method overriding; PointDemo.java, SingletonDemo.java, GarbageCollectionDemo.java, ObjectDemo.java;
2016.9.3 (subtype) polymorphism, up/down casting, binding, abstract classes, abstract methods, final, interfaces; PolymorphismDemo.java, ZooDemo.java, WrapperDemo.java, RPGdemo2.java, InterfaceDemo.java, InterfaceDemo2.java;
2016.9.4 packages, nested classes, anonymous classes, classpath, JAR, exception handling; EnumDemo.java, IteratorDemo.java, NestedClassDemo.java, AnonymousClassDemo.java, StaticNestedClassDemo.java, ExceptionHandlingDemo.java, CheckedExceptionDemo.java, CircleDemo.java;
2016.9.10 (no class)
2016.9.11 file I/O, GUI design, event handling, multithreading; InputOutputDemo.java, FirstGUI.java, SecondGUI.java, MultithreadDemo.java;
2016.9.17 (no class)
2016.9.18 (no class)
2016.9.24 final exam; (FYR: stacks and queues by using linked/array lists (from Princeton Univerisity)); Problem1.java, Problem2.java, Problem3.java, Problem4.java, Maze.java;

Homework

Implement the Depth-first Search (DFS) algorithm to reach the goal state in the following maze problem here. In the zip, you may see 4 java source files. Your job is to use the recursion for DFS in the method agent in the file Maze.java. Use drawBlueDot(int x, int y) and drawBlueDot(int x, int y) to put a blue dot (first visit) and a gray dot (a dead end because there is no more feasible way out) on the visited tile, respectively. You can refer to this page or these slides (just see p. 48) for the detail of DFS.

Gradebook