answersLogoWhite

0

Two key points to remember about constructors are that they have no return type and their names must exactly match the class name.

Methods can have any names and can have any return types.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is different between constructor and method?

Constructors have no return type and their names must exactly match the class name. Apart from this constructors and methods are similar to one another.


What is the similarities between research methodology and research methods?

no


What is the Difference between virtual methods and non virtual methods in c sharp?

A function is a method that returns a value other than void. Methods includes functions, subroutines, constructors, destructors, and properties.


Which is the most usable method or constructor in java?

There is no comparison between methods and constructors. They are both present for a reason and each has its own purpose.


How can you identify a constructor from among any other methods in a class?

Constructors have the same identifier as that of the class, so if the name of your class is Book then your constructor must also be named Book. Constructors have no return type, not even void.


Similarities between graphical and simplex methods?

both are used to solve linear programming problems


What are the similarities and differences between evaporation and distillation?

They are both methods which use heat to separate mixtures.


What types of functions cannot be made virtual?

Static member functions, member function templates and constructors cannot be virtual.


What are similarities between mahatma Gandhi and Nelson Mandela?

They were civil rights leaders and used non violent methods of revolution.


What is factory methods?

Factory methods are merely a convention whereby static methods in a class return an instance of that class. The InetAddress class has no visible constructors. In InetAddress the 3 factory methods getLocalHost, getByName, getAllByName can be used to create instances of InetAddress.


Is php is package?

A package is a mechanism for organizing namespace, constructors, methods and fields. PHP is a technology in itself and contains quite a few packages


What is concession constructor?

Constructors are basically used to evoke methods of a class creating its object..and as far as i know there is no constructor called concession constructor..