Doubt about constructor in JAVA

Posted by Harry Joy on Stack Overflow See other posts from Stack Overflow or by Harry Joy
Published on 2011-01-13T04:17:33Z Indexed on 2011/01/13 4:54 UTC
Read the original article Hit count: 246

Filed under:
|
|
|

I have few doubts regarding constructor in java

  1. Can a constructor be private? If yes then in which condition?
  2. Constructor is a method or not?
  3. If constructor does not return anything then why we are getting a new Object every time we call it.
  4. Whats the default access modifier of a constructor if we did not specify.

Thanks & Regards

Edit----------

Answer for 1 & 3 are very clear. But still doubt about 2&4 as i'm getting different answers for them.

© Stack Overflow or respective owner

Related posts about java

Related posts about tomcat