Static Block in Java with Example

Publié le: 26 avril 2018
sur la chaîne: Automation Testing By Experts
1,353
31

Static block -
Static blocks are the normal block of code, enclosed in braces { }, preceded with static keyword.
Static blocks are used to initialize the static data member.
Static block is executed before main method.
Static blocks will be executed at the time of class loading.
A class can have multiple Static blocks, which will be executed from Top to Bottom.

Static blocks will be executed at the time of class loading hence if we want to perform any activity at the time of class loading we have to define that activity inside static block.


Sur cette page du site, vous pouvez voir la vidéo en ligne Static Block in Java with Example durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Automation Testing By Experts 26 avril 2018, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,353 fois et il a aimé 31 téléspectateurs. Bon visionnage!