meta
<html>
<head>
<title>BlueJ Tutorial: Part 2</title>
<link rel="stylesheet" type="text/css" href="htmlsrc/tutorial.css">
</head>
<body>
<div class="part-links">
<a href="part1.html" class="part-prev">Part 1</a>
<a href="tutorial.html" class="part-toc">BlueJ Tutorial: Part 2</a>
<a href="part3.html" class="part-next">Part 3</a>
</div>
<h2>Terminal</h2>
<p>The cat has some other methods which we can try. Right-click on <a href="guicss:.object-wrapper">the cat1 object</a> again and select the <span class="menu">void listen()</span> method. This will print a message on the terminal, which will appear. Terminal is an old computing word, which refers to a place where you can print text output, and listen for text input. You should see a message saying that the cat meowed at you.</p>
<p>Return to the main BlueJ window, right-click the cat1 object again, and this time choose the <span class="menu">void play()</span> method. The terminal will appear again, asking you what you will get the cat to chase. You will see that <a href="guicss:Terminal .terminal-input-field">the input field</a> is active. Type in what you want, for example: <span class="entry">toy</span> (note that you don't need quotes in the terminal), and press enter. You will then see a message saying that the cat chased the toy.</p>
<p>Minimise or close the terminal window, and return to the main BlueJ window.</p>
<div class="part-end">
<a class="part-next" href="part3.html">Part 3</a>
</div>
</body>
</html>
39 HTM Commands =
green / bluej / lib / tutorial / part2.html