Static Block in Java with Example

Publicado em: 26 Abril 2018
no canal de: 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.


Nesta página do site você pode assistir ao vídeo on-line Static Block in Java with Example duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Automation Testing By Experts 26 Abril 2018, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 1,353 vezes e gostou 31 espectadores. Boa visualização!