Lesson 1.2: Creating Objects

<< Lesson 1.1: Getting Started with JavaLessonsLesson 1.3: Compound Objects >>

Table of Contents

One of the most basic things that you can do in Java is to create objects. Here is an example of a phrase instructing the computer to make a red oval, 50 pixels wide and 80 tall, with its top left corner at (10, 10):

new FilledOval(10, 10, 50, 80, Color.RED, canvas)

In the previous lesson, you wrote phrases like this to make objects, and tried altering the numbers to see what would happen. Your goal in this lesson is to learn to understand the rules of Java grammar that determine how a constructor statement like this may be used. You will also learn a bit about how to specify points on the screen.

<< Lesson 1.1: Getting Started with JavaLessonsLesson 1.3: Compound Objects >>