Question from the Object-oriented programming - Fundamentals test

What does this code return ? public class A { public void talk() { echo "Hello my name is A" } } public class B extends A { public void talk() { echo "Hello my name is B" } } B b = new B(); A a = b; B b2 = (B) a; b2.talk();

Medium

What does this code return ?

public class A {
    public void talk() {
        echo "Hello my name is A"
    }
}


public class B extends A {
    public void talk() {
        echo "Hello my name is B"
    }
}

B b = new B():
A a = b;
B b2 = (B) a;
b2.talk();
Author: SamuelStatus: PublishedQuestion passed 497 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!