Static block ,instance block and method execution flow

Vijay Mylavarapu
1y

In Java, there are several types of blocks that can be used to define code:

  1. 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

Noorjahan Khatoon
2y

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

Shalini Singh
2y

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

Anjali Pal
2y

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

Add answer anonymously...
TCS Java Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter