day2 - COP 3503 Computer Science II CLASS NOTES...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3503 – Computer Science II CLASS NOTES DAY #2 INTRODUCTION TO OOP Terminology Class Complete description of an object Provides the model, or pattern, from which an object is created. Example: An architect creates a blueprint when designing a house. The blueprint defines the important characteristics of the house: walls, windows, doors, electrical outlets, etc. Once the blueprints are created, several houses can be built using the same blueprint. In one sense the houses built from the same blueprint are different. They are in physically different locations, have different addresses, different furniture, and different people live in them. Yet in many ways they are the “same”. The layout of the rooms is the same, the electrical outlets are in the same locations as are the windows, etc. To create a completely different house we need a different blueprint. A class is a blueprint of an object. It defines the type of data that will be held in an object and defines the code for the methods. But a class is not an object any more than a blueprint is a house. Container for methods and data. Reserves no space for data – each object has its own data space (reserved at time of instantiation) Constructors are used to instantiate an object. Instantiation Once a class is defined, an object can be created from it. The process of creating an object is called instantiation . Every object is an instance of a particular class. Example:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

day2 - COP 3503 Computer Science II CLASS NOTES...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online