SHARE
TWEET

Untitled

a guest Jul 20th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Box
  2. {
  3.    private:
  4.      int length;
  5.      int breadth;
  6.  
  7.    public:
  8.      Box(); //--------------------------------> Constructor 1 : Default Constructor
  9.      Box(int length, int breadth);  //--------> Constructor 2 : Parameterized Constructor
  10.  
  11. };
  12.  
  13. Box::Box()
  14. {
  15.    cout<<"Default Constructor called"<<endl;
  16. }
  17.  
  18. Box::Box(int length, int breadth)
  19. {
  20.    cout<<"Parameterized Constructor called"<<endl;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top