Java Programming
Time: 0900 ~ 1200, Saturday and Sunday
Location: Room 223A, 德田館
``Java is C++ without the guns, knives, and clubs.''
-- James Gosling, co-inventor of Java (1955-)
Course Description
To the students,
This course is designed for the students who want to learn Java programming without any experiences before. We will start with the very beginning of program design and the fundamental concepts of how the programs execute the instructions. You are expected to be capable to implement your idea with Java independently after 30 hours of lectures. Furthermore, I wish you could learn other programming languages without suffering from starting over.
Enjoy your coding time.
- Textbook
- References
- Java
- Learning Java, Patrick Niemeyer and Daniel Leuck, 4/e, 2013
- Beginning Java 8 Fundamentals, Kishori Sharan, 2014
- Java in a Nutshell, Benjamin J Evans and David Flanagan, 6/e, 2014
- Introduction to Java Programming: Comprehensive Version, Y. Daniel Liang, 10/e, 2014
- Java: The Complete Reference, Herbert Schild, 9/e, 2014
- Effective Java, Joshua Bloch, 2/e, 2008
- Java Performance: The Definitive Guide, Scott Oaks, 2014
- Data structures and algorithms
- Object-oriented design
- Network programming
- Eclipse
- Additional readings
- Why Learn to Program?, Alex Allain
- 為什麼要學各種程式語言, NiwaSho Lin, 2012.11.21
- 資深開發者給後輩的七個 Coding 學習心得, TechOrange, 2013.11.29
- 大企業都在用哪些程式語言?圖解程式語言編年史, T客邦, 2013.12.16
- The reason everyone should learn to code, Mike Loukides, 2014.1.22
- 如何成為一個偉大的開發者?, TechOrange, 2014.6.20
- 前蘋果高層史丹佛畢典演講:想換工作,別在辦公室等著別人幫你下決定, TechOrange, 2014.7.7
- 沒神奇公式和捷徑,這11步驟就是成為頂尖Coder的必備條件, TechOrange, 2014.7.9
- 高生產力工程師的兩個特徵:聰明、懶惰, INSIDE, 2014.7.14
- 笑傲「演算法」江湖的獨孤九劍, INSIDE, 2014.8.14
- Google工程師親授:菜鳥開發者一定要投資的十大標的, TechOrange, 2014.9.17
- 在美國,寫什麼程式收入最高?答案是:Java, T客邦, 2014.10.9
- 我們之前說錯了嗎?Coding 竟不是新世代必備能力, TechOrange, 2015.2.6
- code 海無涯,不想溺斃就快抓緊這 6 個緊急救生圈吧!, TechOrange, 2015.5.26
- 程式初學者的失落之鑰 - “Computational Thinking”, 程式教育的唐吉訶德, 2015.6.2 (Original: Computational thinking and thinking about computing, Jeannette M Wing, 2008.10.28)
- Related courses
The major topics covered in the short course, time permitting, are listed below for your reference.
- Overview: preliminary knowledge of computer science, installation of Eclipse
- Data types and identifiers
- Operators
- Control structures: selections, iterations
- Classes and objects
- Methods and recursions
- Program design and analysis of algorithms: UML, O-notation
- Object composition
- Inheritance and polymorphism: ``is-a'' relationship, upcasting, downcasting
- Interfaces: ``has-a'' relationship
- Generics
- Exception handling
- File input and output
- Multi-threaded programming
- GUI by Swing
- Fundamentals of network programming
- Applets, servlets, and JSP
- 2015.7.18
- 2015.7.19
- 2015.7.25
- 2015.7.26
- Problem 1: Bisection method. The target function is f(x) = x^3 - x - 2. The approximate root is around 1.523xxxx when [a, b] = [0, 2] and e = 10^-9.
- Problem 2: Write a program for number guessing. Assume that the initial range is between 1 and 100. The player makes a guess and the program shows the feasible range after the program reports that the number is too large/small. For example, suppose that the secret number is 42 and the range is (1, 100). When the player enters 50, the program reports that it is too large and shows the feasible range (1, 49). The procedure continues until the player guesses the secret number or the feasible range is (42, 42). The former case is the player wins; the latter is the player loses.
- Problem 3: Estimating pi by Monte Carlo. You may try various sample size: 1000, 10000, 100000, 1000000, and 10000000 to observe the convergence rate.
- 2015.8.1
- 2015.8.2
- Problem 4: Greatest Common Divisor. Let a and b be two positive integers as inputs. For simplicity, assume a > b. Write two programs for the GCD problem by iteration and recursion. The output is the gcd of a and b.
- 2015.8.8 no class (
Power cut for regular checking Typhoon strike)
- 2015.8.9 (4 hours)
- Class - 1 (Thanks to Mr. Sung)
- Class - 2 (Thanks to Mr. Sung)
- Problem 5: Use the class Point we define in the class (or you can download it) and define a new class Quadrilateral which contains 4 points. You also define several methods in the class:
- Quadrilateral(Point p1, Point p2, Point p3, Point p4)
- boolean isSquare()
- boolean isRectangle()
- double getPerimeter()
- double getArea()
(You can add any new method in the class.)
- 2015.8.15 no class (Power cut for regular checking)
- 2015.8.16 (4 hours)
- 2015.8.22 (4 hours), solution
Sample Codes
As a beginner, avoid copying. Please write the code on your own.
Grading Policy
- Programming Assignments (40 points)
- Final Exam (60 points)
You will get the certificate for this course if you acquire more than 60 points in total.