Objects I

Today we begin introducing you to objects. Objects are an important concept in many programming languages, and particularly in Java. They provide an intuitive way of organizing state and behavior, the two main components of any computer program.

1. Written Exercises (50 Minutes)

As usual, we begin with a written lab component. This one is particularly important, however, so please slow down and complete the exercises carefully. Your course staff will review and discuss your answers along with the rest of your section.

Complete this part of the lab in pairs using Google Docs. Create a copy of our document template, and then edit it to record you and your partner’s answers. Note that you must open this document using your @illinois.edu Google Apps account. We will not grant access to non-Illinois users.

Have a course staff member check your answers as you go. When you are done, move on to the next section.


2. Pokémon Objects (60 Minutes)

Like any other programming concept, the way to get familiar with objects is to use them. In the second half of the lab we’ll provide you with some practice at manipulating object state and using object methods.

And we’ll try to make it as interesting as possible by having you work with a special type of objects: Pokémon objects!

2.1. Forking and Cloning the Lab4 IntelliJ Project

We’ve set up an Lab 4 GitHub repository containing an IntelliJ Project that’s correctly configured for Lab 4. Getting access to it is similar to how you imported MP0. But you have to fork our repository first. If it’s not obvious how to do that, try following these instructions.

2.2. Your Goal

Your job is to complete the provided program so that you can take input from the user and configure each battling Pokémon appropriately.

You’ll need to use your newly-acquired knowledge about objects and object syntax. You’ll also probably want to look into how to use the Java Scanner Class. The course staff will circulate to help out and provide useful advice. You may also find the online documentation helpful.

CS 125 is now CS 124

This site is no longer maintained, may contain incorrect information, and may not function properly.


Created 10/24/2021
Updated 10/24/2021
Commit a44ff35 // History // View
Built 10/24/2021 @ 21:29 EDT