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

What do you mean by local class?

1054


Can we create object of static class?

1079


Explain the concept of proper inheritance?

1108


What do you mean by flow of struts?

1381


What is the function of http?

1066


How you can force the garbage collection?

1033


Why pass by reference is not possible in java?

1109


How to perform quicksort in java?

1192


What do you mean by object?

1033


What is double checked locking in singleton?

1107


What is return data type?

1060


What do you mean by mnemonics?

1112


How can you add and remove nodes in jtree?

1106


Will the compiler creates a default constructor if I have a parameterized constructor in the class?

1170


Why object class is super class for every class in java?

1083