Difference between constructure or distructure
CBSE, JEE, NEET, CUET
Question Bank, Mock Tests, Exam Papers
NCERT Solutions, Sample Papers, Notes, Videos
Posted by Kunal Kumar 3 years, 5 months ago
- 1 answers
Related Questions
Posted by Prawar Narang 6 months, 2 weeks ago
- 1 answers
Posted by Priya Shukla 5 months, 3 weeks ago
- 1 answers
Posted by Hanni Pham 4 months, 2 weeks ago
- 1 answers
Posted by Hanni Pham 4 months, 2 weeks ago
- 0 answers
Posted by Syedali Fathima 5 months, 3 weeks ago
- 1 answers
Posted by Kandeepan Jothivel 6 months, 3 weeks ago
- 2 answers
Posted by Manoj Kumar Manoj Kumar 7 months, 2 weeks ago
- 0 answers
myCBSEguide
Trusted by 1 Crore+ Students
Test Generator
Create papers online. It's FREE.
CUET Mock Tests
75,000+ questions to practice only on myCBSEguide app
Sia ? 3 years, 5 months ago
Constructor
Destructor
Purpose
Constructor is used to initialize the instance of a class.
Destructor destroys the objects when they are no longer needed.
When Called
Constructor is Called when new instance of a class is created.
Destructor is called when instance of a class is deleted or released.
Memory Management
Constructor allocates the memory.
Destructor releases the memory.
Arguments
Constructors can have arguments.
Destructor can not have any arguments.
Overloading
Overloading of constructor is possible.
Overloading of Destructor is not possible.
Name
Constructor has the same name as class name.
Destructor also has the same name as class name but with (~) tiled operator.
Syntex
ClassName(Arguments)
{
//Body of Constructor
}
~ ClassName()
{
}
0Thank You