|
INTERVIEW QUESTIONS
J2EE
JAVA
DETAILS
Question: What is the order of intialization of variables in Java.
Answer: When an object is created, all its fields are set to default initial values for their respective types(zero for all numeric types, false for boolean, u000 for char, and null for object reference.)
Then the constructor is invoked. Each constructor has 3 phases.
1. Invoke a superclass's constructor 2.Initialize the fields using their initializers and any initialization blocks. 3.Execute the body of the constructor.
|
|
|
Category |
Java Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8191 users |
Added on |
7/16/2011 |
Views |
72678 |
Rate it! |
|
|
Question:
What is the order of intialization of variables in Java.
Answer:
When an object is created, all its fields are set to default initial values for their respective types(zero for all numeric types, false for boolean, u000 for char, and null for object reference.)
Then the constructor is invoked. Each constructor has 3 phases.
1. Invoke a superclass's constructor 2.Initialize the fields using their initializers and any initialization blocks. 3.Execute the body of the constructor. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is the difference between Inheritance and Aggrigation?
|
View Answer
|
|
What are some alternatives to inheritance?
|
View Answer
|
|
Which on is best string or string buffer?which one is mutable and immutable?
|
View Answer
|
|
It is essential to catch all types of exceptions
|
View Answer
|
|
In what situations we can use innerclass and anonymous class
|
View Answer
|
|
What is serilization and deserilization
|
View Answer
|
|
What does validate() pack() mean in Frames
|
View Answer
|
|
What is Weak reference and Soft reference in java?
|
View Answer
|
|
When, where and why we are using overloading and overriding???
|
View Answer
|
|
wat is the disadvantage of threads?
|
View Answer
|
|
can dead thread restart?
|
View Answer
|
|
Why String is not a primitive data type
|
View Answer
|
|
As the Swings have more advantages over the AWT.. Why still in market are they using AWTs?? plzz..i want answer..in many interviews they asked me the same.
|
View Answer
|
|
Class hierarchy of AbstractMap is as follows "AbstractMap implements Map" Class hierarchy of HashMap is as follows "HashMap extends AbstractMap implements Map" When AbstractMap implements Map interface and AbstractMap is extended by HashMap, what is the use of again implementing Map interface in the declaration of HashMap?.
|
Class hierarchy - Java Interview Questions & Answers">
View Answer
|
|
wat is the disadvantage of threads?
|
View Answer
|
|
can dead thread restart?
|
View Answer
|
|
Why String is not a primitive data type
|
View Answer
|
|
As the Swings have more advantages over the AWT.. Why still in market are they using AWTs?? plzz..i want answer..in many interviews they asked me the same.
|
View Answer
|
|
Class hierarchy of AbstractMap is as follows "AbstractMap implements Map" Class hierarchy of HashMap is as follows "HashMap extends AbstractMap implements Map" When AbstractMap implements Map interface and AbstractMap is extended by HashMap, what is the use of again implementing Map interface in the declaration of HashMap?.
|
Class hierarchy of H - Java Interview Questions & Answers">
View Answer
|
|
For what purpose java language is named as java?
|
View Answer
|