Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Data Encapsulation in C++

class Box {
public:
double getVolume(void) {
return length * breadth * height;
}

private:
double length; // Length of a box
double breadth; // Breadth of a box
double height; // Height of a box
};
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #Data #Encapsulation
ADD COMMENT
Topic
Name
5+8 =