Navigation menu

18 January 2016

Lesson #03: Instance and more on classes

Suppose I have a class Car, I can create multiple instances of it or in other words multiple objects. Each object will have same feature because they are created from the same Car class but different states.

A state of object is defined by the difference of properties of an object at different intervals.Lets say, a car is moving, its accelerate property will be true if its not moving it will be false. So these are two states.


class Car{

 bool accelerate;

}



Lets have an example of Student class and create some instances so we can understand how instances and classes work and help us.

16 January 2016

Lesson #02: Implementing classes



A class is a generalized blue-print of an object. It contains properties and behaviors of any object. Let's learn how to create classes. 


Classes are simple to implement. A class has 3 important things:
  1. Name of the class 
  2. Properties of class 
  3. Behaviors of class 

Lesson #01: Intro to Object Oriented programming

Object oriented programming is a concept of treating everything as an object which has some properties and behaviors.

What are Objects?

An object is the working prototype of a class.

What is class?

A class is like a generalized blue-print of any object. It contains properties and abilities/behaviors of any object.

Example:


Let’s talk about cars. Toyota Camry and Audi r8. They are two awesome cars BUT how are they related to object oriented programming? Well, both Toyota Camry and Audi r8 are objects.