Back to Using Objects

Lesson PreviewLesson 2 of 10 in this unit

2.2.1 Creating and Storing Objects (Instantiation)

Part of Using Objects in AP® Computer Science A. Read the opening section, then create a free account for the full interactive lesson, practice, and progress tracking.

Creating and Storing Objects (Instantiation)

Now that you know how to make a class, which serves as a blueprint, we will learn how to make objects based on that class. In fact, Java is known for using classes as blueprints for creating objects, which are used to work with and take action on information. This is why Java is called an object-oriented programming language.

An instance is a specific example or single occurrence of something, particularly when an object is created from a class. In Java, an instance is the realization of a class when an object is created using the new keyword.

This means that when dealing with classes, the terms "object" and "instance" are interchangeable.

Continue the full lesson in Stellar

Create a free account to unlock the remaining sections, checkpoints, course practice, and progress tracking for AP® Computer Science A.