JAVA LESSON 3: LEARNING STATIC BLOCK
To create a static block in a Java program, we use a keyword static. If we want to execute any program before the main method, the program should be written inside the static block. The static block is used when you want to perform initialization or any other preparatory actions like connecting to the database or remote serer before accessing a targeted class.
As you can see in the console after executing the code, the instructions written inside the static block has been executed first and then the main method has been executed. It's a very simple concept in Java. I am using Eclipse IDE for learning Java currently.
Leave JAVA LESSON 3: LEARNING STATIC BLOCK to:
Read more #hive-174578 posts
Best Posts From Leo Umesh
We have not curated any of leoumesh's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Leo Umesh
- The Tattoo of My Newborn Baby Girl Forever Inked on My Skin
- Long Weekend Food Feast With Wife
- String Manipulation in C#: Part 2
- String Manipulation in C#
- Introduction to C# and .NET
- Weekend Escape To Falls
- Evening Barbecue With Favourite Beer 🍺 🍻
- NumPy Broadcasting
- Summer BBQ
- Review of "The Day of The Jackal" Series