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 / kabita

constructor & methods are both member functions of a class.
when an object is created the constructor is invoked
automatically,bt we have to call the methods explicitly
through objectname.
methods have returntype ,bt constructors haven't.
constructors must have same name as class name bt methods
have not.
constructors are used for initialization of
objects,variables.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why scanner is used in java?

1069


What is thread start?

956


How to perform quicksort in java?

1111


I want to store more than 10 objects in a remote server? Which methodology will follow?

3199


What are the 6 mandatory procedures for iso 9001?

1031


Mention some features of java?

961


Write a program to search a number in the given list of numbers.

1029


What is Session reduplication and how its done?

2035


Can extern variables be initialized?

949


What is the difference between yielding and sleeping?

1108


Can we convert list to set in java?

982


What is a string token?

1040


What is the purpose of garbage collection in java?

1093


What is object english?

1059


Which one will take more memory: an int or integer?

1229