what is constructor
this is one of special method of any class in java
it's name will same to class name
like this-------
class Demo ------------this is class name
{
Demo ------------this is constrator name
{
}
}
mainly we use it for initialise variables
it can be parameterized
and it can be default
It make automatic called when we maked object of any class
when we do not maked it then java will maked it autometic
this is one of special method of any class in java
it's name will same to class name
like this-------
class Demo ------------this is class name
{
Demo ------------this is constrator name
{
}
}
mainly we use it for initialise variables
it can be parameterized
and it can be default
It make automatic called when we maked object of any class
when we do not maked it then java will maked it autometic
No comments:
Post a Comment