Belong to the class
Accessed using Class Name
Static block is Executed at the time of class loading
Memory is allocated and variables are initialized during class loading
Belong to the object
Accessed using the object Name
Time of object creation
At a time of object Creation
Non-Static Members
1. Non-static blocks are executed only once for the entire class?
a. true
b. false
Ans:- b.
2. A constructor returns a value
a. true
b. false
Ans:- b.
3. The constructor name can be anything
a. true
b. false
Ans:- b.
4. Which of the following can be used to refer to the current object
a. super
b. obj
c. that
d. this
Ans:- d.
5. The compiler will raise an error if we do not provide a default constructor
a. true
b. false
Ans:- b.
6. Which of the following is used to reference object members
a. object
b. class
c. this
d. that
Ans:- c.
7. The non-static members belong to the class
a. true
b. false
Ans:- b.
Comments
Post a Comment