object in OOP(Object oriented Programming)

Written by TechPro Free

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


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

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

// 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
return 0;

About the author

TechPro Free

Techprofree.com is Platform which offers Free download latest project source code of ALL Programming Languages.

Leave a Comment