when the static block will be executed java interview question and answer

1,239 views · Published 4 October 2012 · 3:24 · Indexed 7 October 2026

Channel: Interview DOT · 2012 · Science & Technology

Watch on YouTube

Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications. JOB VACANCIES IN TOP IT / NOT-IT COMPANIES

UPLOAD YOUR RESUME IN 1 MINUTE ! ! !
http://www.interviewdot.com/upload-resume/uploadresume.htm

http://www.interviewdot.com
 
Welcome to www.InterviewDot.com     How to for java prepare for interview Questions :  

Java interview questions and answers

When the "static block" will be executed in Java ? Java interview questions and answers :

Static block will be loaded whenever the class is loaded by JVM after initializing the static variables.


 static int var = 0; 
 static String str = "";
  static { 
  var = 100;
  str = "interviewdot testing";
 }
 public static void main(String[] args) {
  System.out.println("static test");  
  StaticSeperate.display();

 }

http://www.interviewdot.com

For more Java Interview questions and answers  - logon to www.InterviewDot.com - India's Top Interview Guide.
http://www.interviewdot.com

More from this channel