on 2024 May 27 6:02 PM
Hello everyone, please help me with the following question:
You have a superclass super1 and a subclass sub1 of super1. Each class has an instance constructor and a static constructor. The first statement of the program created an instance of sub1. In which sequence will the constructors be executed?
a. Class constructor of super1
b. Instance constructor of sub1
c. Instance constructor of super 1
d. Class constructor of sub1.
Request clarification before answering.
Hello,
The right sequence is:
1.) Static Constructor of super1.
2.) Static Constructor of sub1.
3.) Instance Constructor of sub1
4.) Instance Constructor of super1 finally!
Refer the below SAP link for better understanding,
Thanks,
Sijin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Aligned to the OP question, the exact answer would be {a, d, b, c} :
a. Class constructor of super1
d. Class constructor of sub1.
b. Instance constructor of sub1
c. Instance constructor of super 1
correct options
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.