Single Choice Not Set

QWhat is the output for the below code ?
public class A{
      static{
            System.out.println("static");
      }

      {
            System.out.println("block");
      }

      public A(){
            System.out.println("A");
      }

      public static void main(String[] args){
            A a = new A();
      }
}

ID: #2117 Declaration and Access Control in Java 722 views
Question Info
#2117Q ID
Not SetDifficulty
Declaration and Access Control in JavaTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A A block static
  • B static block A
  • C static A
  • D None of these
Correct Answer

Explanation

static block A

Share This Question

Challenge a friend or share with your study group.