INF1B: Week 3: Classes and Objects; Testing and Debugging
Week Highlights
By the end of this week, you should understand:
From lecture 5:
- what encapsulation is and why it’s useful
- Why focussing programs on objects is useful
- That objects have a state and some behaviours, and what this means
- What classes are, why they are important, and how they relate to objects
- A basic idea of how memory works in Java
- What null is
- What autoboxing and unboxing are
- Calling methods
- Class methods v instance methods
- Global constants
From Lecture 6:
- three types of errors: what they are, when they are detected, and how hard they might be to fix
Lecture 5: Classes and Objects
- Slides: 05-classes-and-objects.pdf
Lecture 5 ➡ Objects First: read Chapter 1. Objects and Classes (pp 3-19), skipping parts that are specific to the BlueJ IDE.
Lecture 6: Testing and Debugging
- Slides: 06-testing-and-debugging.pdf
Lecture 6 ➡ Objects First: read Chapter 9. Well-Behaved Objects (pp 295-328)
Lecture 6 ➡ Java Tutorial: read Chapter 10. Exceptions
Tutorial: Pair Programming
This week will have some introductory exercises and look at pair programming.
You can find the tutorial materials here: tutorials
You don't need to prepare for the tutorial in advance. The exercises are made to be done in groups during the tutorial session. If you are unsure about anything, feel free to ask on Piazza.
The tutorials are not assessed so solutions are available too. However, you will learn the most if you attempt the exercises yourself first -- don't be tempted to just read the solutions. If you're stuck on an exercise, but don't want the full solution, you can ask for a hint on Piazza.
Lab exercises
This week's lab exercises cover arrays. There are three warmup exercises, three core exercises, and one optional exercise.
What should I be doing with assessment?
Assignment 1 is released this week. Make sure you spend about 3 hours this week beginning work on it.