d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Is This Correct?
Add Reply New Topic New Poll
Member
Posts: 20,271
Joined: Oct 5 2007
Gold: 0.00
Apr 18 2015 06:30pm
is class Base {

public: < -- class?

// public members go here

protected: < -- class?

// protected members go here

private: < -- class?

// private members go here

};

are these the 3 classes? or do they define / declare whats in the class?

or is

class Box
{
public: < public member? declared? in ^
double length;
void setWidth( double wid );
double getWidth( void );

private: < private member? delclared?
double width;
};

the class?


This post was edited by Gwiido on Apr 18 2015 06:31pm
Member
Posts: 39,205
Joined: Jun 25 2006
Gold: 13.21
Apr 20 2015 11:11am
class randomClass {...}

everything in the brackets define a single class (in this case its randomClass)
everything under public : defines the functions/attributes of the randomClass that are public (can be accessed by anyone/anything)
everything under protected : only inheriting classes can access them
everything under private : only the class itself (randomClass) can access them
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll