Order of execution in java Class contains multiple blocks
Vložit
- čas přidán 27. 07. 2024
- Please check out my blog(learnsimple.in) for more technical videos.
This video explain the sequence of java program when class contains different blocks like Static, initialization block and constructor
You simplified this concept, keep doing the good work.
Hi Siva ,
Thank you for your presence in you tube .it is helping many of us to understand the
core concepts easily . the information you provide are more valuable , and to the point .
continue your effort. if you make some videos in the following topic it will definitely be
helpful for us .
casting of user defined objects -- UP CASTING and DOWN CASTING
i.e 1.from a super class object to sub class object and vice versa
2.from an interface instance to class instance and vice versa ( i.e from a higher Level to a Lower Level )
As per my knowledge, after static block, constructor gets invoked before Initialization block , but this block is placed as the first statement in constructor that's why it seems that Initialization block is invoked before constructor but behind the scenes constructor is invoked first.