Learn Java Programming - Static Initialization Block Tutorial

Published: 16 August 2015
on channel: Daniel Ross
4,915
59

This tutorial will build on concepts from both my Instance Initialization Block Part 1 and Instance Initialization Block Part 2 tutorials. I highly recommend watching those tutorials before continuing with this tutorial.
There are some major differences between instance and static initialization blocks. A static initialization block is not dependant upon a constructor to be invoked. A static initialization block is executed when the class is first accessed, either to create an instance, or to directly access a class variable or a static method. A static Initialization block will only be executed once throughout the entire program; it won't matter how many objects you create or if you directly access a static member a bazillion times.


On this page of the site you can watch the video online Learn Java Programming - Static Initialization Block Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Daniel Ross 16 August 2015, share the link with friends and acquaintances, this video has already been watched 4,915 times on youtube and it was liked by 59 viewers. Enjoy your viewing!