Prerequisite review (January 25)
Resources:
- Chapters 1-7 of Think Java
- Chapters 1-6 of Java in Two Semesters (log in with your CUNYfirst credentials)
- Videos 4-51 of this playlist
- Videos 4-44 of this playlist
- Units 1-4 and 6 of CSAwesome
- Great tool for tracing and debugging Java programs: Java Visualizer. Make sure to click on “options” and check the two options on the left. (This makes the visualizer provide a more accurate picture of memory.)
- Many practice exercises:
Class material (Click on “Show code” and then choose from the files on the left)
Homework:
- First, sign in to CodeLab and access the area for our course. Here is some information about CodeLab.
- Assignment 1: due February 1 at 6pm
- Assignment 2: due February 5 at 11:59pm
Command line (February 1)
How to practice using the Unix/Linux command line:
- Running commands on your local machine:
- For Linux and macOS: you can use the built-in Terminal. Another option is to install Git Bash.
- For Windows: although Windows comes with something called the Command Prompt, it is not as powerful as the Linux command line. To mimic the real thing, you may install Git Bash or WSL (Windows Subsystem for Linux).
- Using the Linux computers on campus:
- Computers running Linux are available in the WEB (West End Building, the red two-story building near Ocean Avenue).
- Username and password information is here.
- You can connect to these machines remotely from your own; follow the instructions here (not written by me).
- Note for Windows: you do not really have to download the program as the instructions say. You should be able to use SSH directly in the Command Prompt as in the Mac Terminal.
- In the browser: for any operating system, you can use Replit’s console (or shell), which is a Linux command line.
- Note: many IDEs, such as IntelliJ IDEA and Visual Studio Code, allow you to open a command line (they may call it a “terminal”) within the IDE.
Resources:
- Unix/Linux commands: there are numerous resources online, including:
- UNIX Tutorial for Beginners
- Introduction to UNIX (with exercises)
- The Command Line
- UNIX Tutorial
- and these two videos.
- Compiling and running Java programs at the command line: section 1.4 of Think Java.
- Command line arguments
Class material (Click on “Show code” and then choose from the files on the left)
- Commands to know: echo, cat, mkdir, touch, cd, rm, rmdir, ls, pwd, mv, cp, javac, java. Also (these are used together with commands): .., <, >, *, ?, {}, &&
- Summary of some basic commands
Homework:
- Assignment 3: due February 8 at 6pm
Objects and references (February 8)
Resources:
- Chapter 7 of Java in Two Semesters (log in with your CUNYfirst credentials)
- Chapters 9 and 10 of Think Java
- On StringBuilder:
Class material (Click on “Show code” and then choose from the files on the left)
Homework:
- Assignment 4:
Classes (February 15, 22)
Resources:
- Chapter 8 of Java in Two Semesters (log in with your CUNYfirst credentials)
- Chapters 11-13 of Think Java
- Videos 57-64 of this playlist
- Unit 5 of CSAwesome
- Sections 5.1-5.4 of Introduction to Programming Using Java
- Enums (we did not have time to cover this topic):
- Section 2.3.5 of Introduction to Programming Using Java
- “Enum Types” from the official Java Tutorials
Class material (Click on “Show code” and then choose from the files on the left)
Homework:
- Assignment 5:
- Assignment 6:
Exam 1 (March 1)
- Topics: everything from the beginning of the course through the topic of classes.
- All exam questions will be similar to homework questions or questions from previous semesters.
- Questions and answers from previous semesters
- Fall 2022 Exam 1
- Recording of Q & A meeting on Zoom (Sunday 2/26 at noon)
- Spring 2023 Exam 1 with solutions
Inheritance, polymorphism, and the Object class (March 8, 15)
Resources:
- Chapter 9 of Java in Two Semesters (log in with your CUNYfirst credentials)
- Videos 65-71 and 74 of this playlist
- Unit 9 of CSAwesome
- From the official Java tutorials: inheritance, polymorphism, super, Object, abstract, packages
- Chapter 14 of Think Java
- Sections 5.5-5.6 of Introduction to Programming Using Java
Class material (Click on “Show code” and then choose from the files on the left)
Videos:
Homework:
- Assignment 7: due on March 22 at 6pm on CodeLab
ArrayLists (March 22)
Resources:
- Videos 72 and 73 of this playlist
- The ArrayList class documentation
Class material (Click on “Show code” and then choose from the files on the left)
Homework:
- Assignment 8: due 4/2
Exceptions (March 29)
Resources:
- Chapter 14 of Java in Two Semesters (log in with your CUNYfirst credentials)
- Videos 75-82 of this playlist
- Section 3.7 and Chapter 8 of Introduction to Programming Using Java
- Official Java tutorial
Class material (Click on “Show code” and then choose from the files on the left)
Video on exceptions (continuation from class)
Homework:
- Assignment 9: due 4/25
Interfaces, lambda expressions (April 19)
Resources:
- Chapter 13 of Java in Two Semesters (log in with your CUNYfirst credentials)
- Sections 4.5 and 5.8 and Chapter 10 of Introduction to Programming Using Java
Class material (Click on “Show code” and then choose from the files on the left)
Video on Comparators and lambda expressions (continuation from class)
Homework:
- Assignment 10: due on 5/3
Exam 2 (April 26)
- Topics: everything from inheritance through exceptions; not interfaces.
- All exam questions will be similar to homework questions, or questions from previous semesters:
- Questions and answers (ignore #4. In #7, skip the compareTo method for now, though it will be on the final exam)
- Spring 2022 Exam 2 (in #8, skip the compareTo method for now, though it will be on the final exam)
- Summer 2022 Exam 2
- Fall 2022 Exam 2
- Dynamic binding practice
- Q&A meeting recording
- Exam 2 with solutions
Collections (May 3)
Resources:
- Chapter 15 of Java in Two Semesters (log in with your CUNYfirst credentials)
- Chapter 10 of Introduction to Programming Using Java
- Documentation (we will cover only a small fraction of the interfaces, classes, and methods mentioned here):
Class material (Click on “Show code” and then choose from the files on the left)
Homework:
- Assignment 11: on CodeLab
Recursion (May 10)
Resources:
- Chapter 8 of Think Java
- Unit 10 of CSAwesome
- Section 9.1 of Introduction to Programming Using Java
Class material (Click on “Show code” and then choose from the files on the left)
Homework:
- Assignment 12: on CodeLab
JavaFX (Optional)
Resources:
- Chapters 10 and 16 of Java in Two Semesters (log in with your CUNYfirst credentials)
- Chapters 6 and 13 of Introduction to Programming Using Java
Network programming (Optional)
Resources
- Sections 11.4 and 12.4 of Introduction to Programming Using Java
- Chapter 23 of Java in Two Semesters (log in with your CUNYfirst credentials)
- “Java Socket Programming Examples” by Ray Toal
- Four videos: part 1, part 2, part 3, part 4
Final Exam (May 17 at 6:00)
- The final exam will be cumulative.
- All exam questions will be similar to homework questions (assignments 1-12) or questions from previous semesters, which you can find above in the areas for exams 1 and 2.
- It may be helpful to review exams 1 and 2 with their solutions, posted above.
- Below are exams from previous semesters. Do not assume that this semester’s exam will be similar to these. But they may nevertheless be helpful.
- Q&A recordings: part 1, part 2