Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Differentiate constructor and a method and how are it be
used?

Answer Posted / pranab dutta

A constructor is a member function of a class that is used
to create objects of that class where as a method is an
ordinary member function of a class.
Constructor has the same name as the class itself and
Member has its own name.
A Constructor has no return type, and is invoked using the
new operator.. Whereas a Member has a return type (which
may be void), and is invoked using the dot operator.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where are register variables stored?

977


What things should be kept in mind while creating your own exceptions in java?

1103


Name few java util classes introduced with java 8 ?

882


What is the difference between C++ and Java and your preferences?

1073


What is arguments in java?

965


why not override thread to make a runnable? : Java thread

961


What is meant by nested loop?

983


What are some examples of variable costs?

900


What is difference between synchronize and concurrent collection in java?

998


What is difference between equals and hashcode method?

1058


What is the use of default method in interface in java?

973


What is a method signature java?

994


How does split work in java?

1001


what is method reference in java 8?

983


Difference between association, composition and aggregation?

935