We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Static block is used to run code when a class is intialized or you can say before static void main function is called the static block will be run. so any calculations needed before the main funcation can be done in there. Hope this helps
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Static Initializer Block
You are viewing a single comment's thread. Return to all comments →
Static block is used to run code when a class is intialized or you can say before static void main function is called the static block will be run. so any calculations needed before the main funcation can be done in there. Hope this helps