Tuesday, September 8, 2009

CONSTRUCTOR (JAVA)

01.WHAT IS COSTRUCTOR IN JAVA?
ans. in java constructor initialize an object.In consturctor class name and constrructor name must be same .It has no return type even void .

CONSTRUCTOR are two type in java.i)default , ii)parameterized.

EXAMPLE:
class A{

A(){ // DEFAULT CONSTRUCTOR......
}

A(1,2,3){ //PARAMETERIZED CONSTRUCTOR...
}
}

N.B:IN JAVA COPY CONSTRUCTOR NOT SUPPORTED i,e.IN JAVA COPY CONSTRUCTOR NOTHING BUT A GENERAL CONSTRUCTOR.......

1 comment:

  1. Hello...............................


    I feel very happy while reading your blog.I had got all the information that i am in the need so i feel very thank full to you. please update relevant information in your blog.


    While i am searching for the same in Google i had got lot of information in the other blog like your blog.


    http://www.adminkernel.com/networking-articles/

    ReplyDelete