Join
Blogs
Questions
Videos
Tags
Members
Search
 
 
Create your own blog, earn points and get popular!

What is difference between method and constructor?

Constructor is a special member function of a class which is used to create object of that class. Constructor has a same name as that of the class. It also does not have any return type. However, constructor may have arguments.
 
Method is a member function of class which has its own name (different from the class name). Method has return type specified (if method does not return anything, the return type is void). Method is invoked using dot (.) operator.
Your rating: None Average: 5 (3 votes)
Share this
Anonymous's picture

good one :)

good one :)
Anonymous's picture

very goood

very goood
Anonymous's picture

very goood

very goood

Post new comment

2 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.