Ayush Shrivastava 🇮🇳@ayshriv
Static Block
Ever wanted code to run just once? Use a static block.
static {
System.out.println("App loaded");
}
Runs only once when the class is loaded.
Great for initialization.
#JavaTricks #DevCommunity #static #block #ayshriv #java
1536983



