Inf1 OP
Overview

Every week you will be set a number of programming tasks that you are required to complete. The best way to learn a language like Java is to use it, and these exercises get you started on that process. Along the way, you will gain a better understanding of the concepts of imperative and object oriented programming.

The exercises will start off simple, building on the lecture material, but will become progressively more complex each week. They are designed so that the later exercises build on the knowledge you gained from the previous ones. Read the whole of an exercise before starting it to ensure you fully understand what is required.

A range of skill levels are expected. At a minimum, all students are expected to understand the concepts in the Fundamentals set of lab exercises, and be able to successfully complete the exercises there.

For those students who have either had prior experience programming Java or similar languages, or who want more challenging exercises, there is an additional set of advanced lab exercises. These are based on a range of advanced Java topics. It is expected however that students trying these advanced topics have first mastered the fundamentals of Java, and the exercises of the Fundamentals section.

Introduction to Development Tools

Before you dive into the first coding exercise, read the documents explaining the Development Tools and Getting Started (linked in the Course Materials > Getting Started folder on Learn). This is especially important if you want to use your own machine for the exercises. The Getting Started document will also explain how you can run automatic tests to verify the correctness of your solutions.

If you have any trouble setting up your coding environment, please ask for help on the course's Piazza forum.

Fundamentals

Each week's lab consists of an overview of the topics to be covered, and a series of exercises of increasing difficulty. There will usually be JUnit tests provided to prove your code works as required. Using JUnit for automatic testing is covered below.

Advanced

Each advanced topic will consist of pointers to relevant material in the Oracle Java Tutorial, and other sources. You should cover the material there, before attempting exercises to demonstrate what you have learned from there. Again where applicable, JUnit tests will be used to prove the exercises have been successfully completed.

Each topic is usually based on a certain group of classes or packages in the Java API. The classes in each of these groups are designed to work together to accomplish specific goals. For example, database handling, or multithreading.

It is recommended you work through the first three advanced labs (Java Class Design, Advanced Class Design, and Object-Oriented Design Principles) initially before attempting the rest. The remaining labs can be worked through in any order.

Lab Exercise Solutions

You can find solutions for all fundamental lab exercises and some of the advanced exercises in the Java Files section at the bottom on the left.