Use of Static Block in Java
In this class, We discuss the Use of Static Block in Java.
The reader should have prior knowledge of static variables in Java. Click here.
Static Block:
A block of code written with the keyword static is called a static block.
Example:
The below diagram shows the example code.
In the above code, we have two static blocks.
We can write any number of static blocks.
Static blocks are executed when the class is loaded to Random access memory.
One of the uses of the static block is to initialize the static variables.
In real life, we have many uses for static blocks.
We can call static methods in static blocks.
Link for playlists:
/ @wisdomerscse
Link for our website: https://learningmonkey.in
Follow us on Facebook @ / learningmonkey
Follow us on Instagram @ / learningmonkey1
Follow us on Twitter @ / _learningmonkey
Mail us @ learningmonkey01@gmail.com
En esta página del sitio puede ver el video en línea Use of Static Block in Java || Lesson 47 || Java Programming || Learning Monkey || de Duración hora minuto segunda en buena calidad , que subió el usuario Wisdomers - Computer Science and Engineering 13 julio 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 162 veces y le gustó 3 a los espectadores. Disfruta viendo!