The codepad in BlueJ allows you to execute Java code directly, without having to first add it to an editor and compile. By default, the codepad is hidden in BlueJ. To show it, you must click the triangular arrow on the right-hand side of the object bench. To hide it, simply click the arrow a second time. (You can also go to the View menu and click Show Code Pad.) Click in the bottom row of the codepad and write the following then press Enter:
new Cat()
Note that it's important to not put a semi-colon at the end of the line, even though you're used to doing so in Java. The codepad accepts statements (with a semi-colon at the end, which return no value), or expressions (without a semi-colon, which return a value). We want an expression, so we leave off the semi-colon. You'll see a result line appear, with a tiny red object icon on the left side. If you hover over the red box, you'll see an arrow appear indicating that if you click, the result will be added to the object bench. Click, and you'll be asked for an object name. Leave it as "cat1" and click OK.
Now that cat1 is on the object bench, we can use it in the codepad. Write the line below in the codepad and press Enter:
cat1.listen();
This time we do use a semi-colon, as it is a statement. The terminal will pop up saying the cat meowed, just like last time we invoked the method; minimise or close it. Enter the following two lines in the codepad, pressing Enter after each one:
cat1.feed();
cat1.listen();
You will find that after being fed, the cat purrs instead. (Note: you'll need to have added the feed method as shown in part 3.)