Constructor in Java

105 views · Published 1 February 2014 · 2:30 · Indexed 23 September 2026

Channel: Interview DOT · 2014 · Science & Technology

Watch on YouTube

Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications. Constructor in Java
Constructor in Java ? Java Interview Question And Answer ?

Constructors in Java :

1.Constructor in Java is block of code which is executed at the time of Object creation.

2.Constructor is entirely different than methods and has some specific properties like name of constructor must be same as name of Class.

3.Constructor also can not have any return type, constructor's are automatically chained by using this keyword and super.

4.Object initialization code is normally placed in Constructor.

5.We can overload constructors using different parameters.

6.Every Class in Java has constructor, if no explicit constructor is specified by Programmer, Java Compiler inserts a no argument constructor inside class. This is also called default Constructor in Java

7.Calling one constructor from another constructor in Java is called Constructor chaining.
Constructor in Java:

8.You can use any access modifier with Java constructor. they can be public, protected or private.

9.Constructor in Java can not be abstract, static, final or synchronized.

10.Constructor can throw Exception in Java.

11.Constructors are not inherited.

12.Privae Constructors can be used to create "Singleton" pattern.
A Job Portal
http://www.InterviewDot.com http://www.InterviewDot.com http://www.InterviewDot.com
One Click Dream Job - http://www.interviewdot.com/upload-resume/uploadresume.htm

Are you looking for a new Job ?
InterviewDot.com - A Job Portal
http://www.InterviewDot.com http://www.InterviewDot.com http://www.InterviewDot.com
One Click Dream Job - http://www.interviewdot.com/upload-resume/uploadresume.htm




Constructor in Java

More from this channel