Search Interview Questions
| 3027 questions in repository.|
There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Java - Interview Questions and Answers|
|Ans. Declaration is intimation to the compiler about the nature of Data a reference is going to hold.|
For example - List myList;
Instantiation is reservation of memory.
myList = new ArrayList();
Initialization or construction is setting the default values for member elements.
myList = new ArrayList(mySet);
** Example 2nd is both for instantiation as well as initialization. The only difference is that 2nd will initialized the member elements to their default values whereas 3rd will initialized it with the elements from set.
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve declaration instantiation initialization construction Hewlett Packard (HP) basic   frequent|
|What are the common uses of "this" keyword in java ?|
|Can we use both "this()" and "super()" in a constructor ?|
|Why every object constructor automatically call super() in Object before its own constructors?|
|What are constructors and Destructors in Java ?|
|Does Constructor creates the object ?|
|Can constructors be synchronized in Java ?|
|Are constructors inherited? Can a subclass call the parent's class constructor? When?|
|Difference between object instantiation and construction ?|
|Difference Between this() and super() ?|
|Which of the following is false about Constructors ?|