title: Why is the following code working with an interface but without any class defined?
body: <pre><code>interface Main 
  {
  public static void main(String[] args) 
  {
      System.out.println("Inside main");
      int a = 4 , b = 6 ;
      System.out.println(a+b);
  }
  }
  </code></pre>
  
  <p>In the above code, there is no class defined but the program is still getting executed. But as far as I know, there cannot be any static method inside an Interface. And, every program should contain at least one main function. </p>