I am calling a function from class A "setbrakes" in which another function is called named "fun" and i have same function in class B which extends class A.