What is constructor ?

No comments

Constructor :-

Constructor is a member function having the same name of its class and is executed automatically when the object is created.

Example :-    class student
                                   {
                                        private:
                                         int roll;
                                        public:
                                         student ()
                                                      {
                                                            Cout << “object is created”;
                                                       }
                                       };

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀