Constructor within a class, has the same name as a class name.
eg:
class test{
test(){//code goes here}//constructor
}
Constructor of a class is called automatically when object of the class is
created.
test tc= new test();// test() constructor is called.
Constructor does not have return type.
There can be multiple constructor with difference in number of arguement it
accepts.
If there are no constructor defined, a non- argument constructor is inserted
by the compiler
these are some of features of constructor. Please correct if anything is
wrong or doesnot imply
On Fri, Jun 18, 2010 at 11:28 AM, ahmed eissa <[email protected]>wrote:
> Hi,
>
> I can't understand the constructors, so can anyone recommend me a
> book, or explain it to me in his own way!
>
> Thanks
>
> --
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]<javaprogrammingwithpassion%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/javaprogrammingwithpassion?hl=en
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en