OOP

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.

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

TechPro Free

Techprofree.com is Platform which offers Free download latest project source code in java, android, php, html, c# .net, c/c++, iphone, vb, python, jsp, asp .net, all programming lanugage.

Leave a Comment