Q:

When an instance of a class is not created in the main method, will the default constructor be called?

When an instance of a class is not created in the main method, will the 
default constructor be called?
ex:
class A{
    public static void main(String args[]){
        System.out.print("Hello")
    }
}

in this case, will the default constructor of A be called?

A:

Constructor is invoke when you create object. Main method is static so it is not needed to create object of A class so the constructor won't be invoked.
Below is situation when default constructor is invoked because you create an instance of A class. I create my own constructor just to know if the text inside of it is printed that's the proof that it is invoked
public class A {

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

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

   private void print()
   {
       System.out.println("Text printed");
   }
}

Output:
Constructor invoked
Text printed

