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...

What is meant by constructor?

Answer Posted / ravina gaikwad

Constructor is special type of member function that will
automatically invoke when an object creates. The purpose of
constructor is for the initialization of instance
variables. A constructor having the same name as that of
class name. It may have arguments but doesn't return
anything.
If we want to initialize all objects of the same class
with same values, use default constructor.Otherwise, we can
use parameterized constructor if we want to initialize
objects of the same class with different values. If we
don't specify any constructor , compiler will use default
constructor with garbage value.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between quicksort & mergesort? When should they be used? What is their running time?

1024


What is stringjoiner ?

907


What is difference between this and super keyword?

937


Can I overload to string method

1387


Can we have multiple public classes in a java source file?

1099


Can a class be protected in java?

914


What are the types of casting?

1006


Can you create an object of an abstract class?

948


what methods would you overwrite in java.lang.object class?

951


Does list allow duplicates in java?

879


Which is the best approach for creating thread ?

1135


What is the difference between equals() and == in java?

914


Write a program to find the whether a number is an Armstrong number or not?

953


How many ways can we create the string object?

958


Will minecraft java be discontinued?

1113