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

waht happens when a return type ,even void is specified for
a constructor?

Answer Posted / chandra rekha

The constructor has the same name as that of the class to
which it belongs to. When a return type or void is
specified,no error occurs.It will be considered as a method.
for example:
public class myclass
{
public myclass()
...
}this is considered as a contrustor
whereas,
public class myclass
{
public void myclass()
{
...
}will be considered as a method.....

Is This Answer Correct ?    33 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to convert string to byte array and vice versa?

1088


What is null statement?

1017


Can a static class have a constructor java?

987


How do you initialize an arraylist in java?

1042


What are the rules for naming an array?

1060


What are java threads?

1134


Explain restrictions for using anonymous inner classes?

1094


Give an example of use of pointers in java class.

1031


How does map works in java?

1004


Explain the difference between comparator and comparable in java?

957


What is the meaning of 3 dots in java?

1166


What happens when a thread cannot acquire a lock on an object in java programming?

1016


What is an object class?

1026


Can an integer be null java?

1007


What Is Composition?

1055