title: Can a same method exist in a class twice, through Inheritance and interfaces?
body: <p>Here is the scenario:-</p>
  
  <pre><code>class Canine{
    public void roam(){
      System.out.println("Canine-Roam");
    }
  }
  
  public interface Pet{    
    public abstract void roam();
  }
  
  
  class Dog extends Canine implements Pet{
  
    public void roam(){
      System.out.println("Dog Roam");
    }
    public static void main(String [] args){
      Dog adog = new Dog();
      adog.roam();
    }
  }
  </code></pre>
  
  <p>I am aware that JVM must not have any confusion in choosing which method to run, that means, which method gets over-ridden. But I am confused anyway. Why does this program compile?</p>