Home | | Object Oriented Programming | OOP Using C++

Chapter: Object Oriented Programming(OOP) : Advanced Programming

OOP Using C++

Declaring a variable of a class type creates an object. You can have many variables of the same type (class).

OOP USING C++

Creating an object of a Class

 

§    Declaring a variable of a class type creates an object. You can have many variables of the same type (class).

–   Instantiation

 

§    Once an object of a certain class is instantiated, a new memory location is created for it to store its data members and code

 

§    You can instantiate many objects from a class type.

 

Ex) Circle c; Circle *

 

Implementing class methods

 

§    Class implementation: writing the code of class methods.

 

§    There are two ways:

 

1.     Member functions defined outside class

 

 

§    Using Binary scope resolution operator (::)

 

§    “Ties” member name to class name

 

§    Uniquely identify functions of particular class

 

§    Different classes can have member functions with same name

 

2.     Format for defining member functions

 

ReturnType ClassName::MemberFunctionName( ){

}

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
Object Oriented Programming(OOP) : Advanced Programming : OOP Using C++ |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.