Computer Science, asked by Anonymous, 8 months ago

What should be the execution order, if a class has a
method, static block, instance block, and constructor?
Select one:
a. Method, constructor, instance block, and static
block
b. Instance block, method, static block, and
constructor
c. Static block, instance block, constructor, and
method
d. Static block, method, instance block, and
constructor​

Answers

Answered by Anonymous
0

The order of execution is: The static block will execute whenever the class is loaded by JVM. Instance block will execute whenever an object is created, and they are invoked before the constructors. ... The constructor will execute after the instance block, and it also execute every time the object is created.

Answered by ravisainemp21
0

Explanation:

i hope its help to you

pls mark me as brainlist

Attachments:
Similar questions