Q:

Code Snippet involving Inheritance

The code I am running is as follows : 
public class Triangle {   
     public void draw() { 
         System.out.println("Base::draw\n");  
     }  
     public void computeCentroid(Triangle t) {  
         System.out.println("Base::centroid");
     }
}

class RightAngledTr extends Triangle {  
    public void draw() { 
       System.out.println("RightAngle::draw\n" );  
    }  
    public void computeCentroid(RightAngledTr t) {
       System.out.println("RtAngle::centroid");    
    } 
}

public static void main(String[] args) {
    Triangle tr= new RightAngledTr();
    RightAngledTr rtr= new RightAngledTr();  
    tr.computeCentroid(tr); 
    tr.draw(); 
    tr.computeCentroid(rtr);
}

The output this gives is as follows : 
Base::centroid
RightAngle::draw
Base::centroid

I don't understand the reason behind the third output line. 
My doubt : 
tr.computeCentroid(rtr) should call the method of Derived class RightAngledTr(since the parameter passed is rtr). Hence print : RtAngle::centroid
Please help me out here. Thanks in advance!

A:

public void computeCentroid(RightAngledTr t)

and
public void computeCentroid(Triangle t)

have different method signatures, so there is no override here, at all.

