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

In a container there are 5 components. I want to display all the component names, how will you do that?

2137


Does java support function overloading, pointers, structures, unions or linked lists?

1036


What do you mean by byte code?

954


How can we create a synchronized collection from given collection?

1037


Is java an open source?

926


Is the empty set a singleton?

909


what is meant by HQL?

1011


What best practices should you follow while writing multithreaded code in java?

996


Is int a class in java?

941


Can we override constructors?

938


How thread scheduler schedule the task?

1003


What is the difference between the direct buffer and non-direct buffer in java?

976


What is java instanceof operator?

984


What is the abstraction?

968


Can we define package statement after import statement in java?

954