Static block ,instance block and method execution flow
In Java, there are several types of blocks that can be used to define code:
Static blocks: Static blocks are blocks of code that are marked with the
static
keyword and are executed when the class is fi...read more
static block is a set of instructions that is run only once when a class is loaded into memory
Class Hello {
static{
System.out.println("hello static"):
}}
Instance black is similar to method which h...read more
A static block is a block of code with a static keyword. In general, these are used to initialize the static members of a class. JVM executes static blocks before the main method at the time loading a...read more
Static Block - a static block is a set of instructions that is run only once when a class is loaded into memory.
Instance Block - it is an element of a class which serves the same two purposes as serv...read more
Top TCS Java Developer interview questions & answers
Popular interview questions of Java Developer
Reviews
Interviews
Salaries
Users/Month