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
На этой странице сайта вы можете посмотреть видео онлайн Use of Static Block in Java || Lesson 47 || Java Programming || Learning Monkey || длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Wisdomers - Computer Science and Engineering 13 Июль 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 162 раз и оно понравилось 3 зрителям. Приятного просмотра!