C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
2
Reply
What is Constructor?
Raj Kumar M
17y
5.6k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
A construcor is a method that returns nothing, It is used to instanciate an object and also helps us to perform some tasks exactly when the object is instanciated example: class MyClass { //no constructor ............... } When I want instanciate an object I can't example: MyClass object = new ? class MyClass { MyClass() {MessageBox("Hi I'm MyClass instance")} } MyClass object = new MyClass() When I execute the program the first think done is to display message "Hi I'm MyClass instance"
Bechir Bejaoui
17y
0
When we create instance of class a special method of that class, called that is constructor. Similarly, when the class is destroyed, the destructor method is called. These are general terms and usually not the actual member names in most object-oriented languages. It is initialized using the keyword New, and is destroyed using the keyword Finalize
Raj Kumar M
17y
0
What is diff. between abstract class and an interface?
What do u mean by Function Overloading ?
Message