OOP

object in OOP(Object oriented Programming)

Written by Zaheer Alam

An object is an entity or instance of class. each object has properties and behaviors.

Example

// C++ program to demonstrate
// accessing of data members

#include <bits/stdc++.h>
using namespace std;
class Geeks
{
// Access specifier
public:

// Data Members
string geekname;

// Member Functions()
void printname()
{
cout << “Geekname is: ” << geekname;
}
};

int main() {

// Declare an object of class geeks
Geeks objName;

// accessing data member
objName.geekname = “zee”;

// accessing member function
obj1.printname();
return 0;
}

About the author

Zaheer Alam

Zaheer Alam is an Software Engineer Graduated From Well Versed institute of Aisa, Comsats University.He is inclined toward helping People improve their Programming Skill to the Next Level.He also works work as social media content creator on various pages and groups with the huge fan following.

Leave a Comment