Objects, Classes, and Instances

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Instance

An Instance or Object is a concrete representation of a Class

Object

An Instance or Object is a concrete representation of a Class Each instance (object) contains instance variables which are the state of the object (attributes). Object behaviors are represented by methods.

Behavior

Behavior is what something does.

Class

In programming, a Class is something that models: State Behavior A thing can be a car, a book, and so on. Such things become classes (the blueprints of objects), and we create objects out of these classes.

State

State is what something is

Attributes

We can model attributes in code by using instance variables. Generally we define these instance variables in a special method called initialize that is run every time a new instance of a class is created.

self

self is ruby's way to identify the current object


Kaugnay na mga set ng pag-aaral

Chapter 16 Outcome Identification and Planning

View Set

Final Substance Abuse and Treatment

View Set

FIN 4100 Ch 3&4 from book Quiz 1

View Set

Disease State: Erytrocytes- Anemia- Microcytic

View Set

Social Studies HW due 2/25/09; Tensions in Europe.

View Set