title: What is this type of method overriding called in Java?
body: <p>I'm relatively new to Java and I'm using a new API. I came across this method override and I'm not sure what this is called:</p>
  
  <pre><code>public void exampleMethod() {
      Button loginButton = new Button("login"){
         public void onSubmit(){
            //submit code here
         }
      };
  }
  </code></pre>
  
  <p>From what I understand, this is overriding the onSubmit method of the Button class. I've never come across this type of overriding before. Is there a specific name for it? I want to read up more about it but I can't find it. All my searches so far result to regular method overriding by creating a new class, which is what I'm already familiar with.</p>
  
  <p>I'd appreciate if someone could point me in the right direction.</p>
  
  <p>Thanks.</p>