Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

method(b); // which method? method(base) or method(derived)?

base derived method
0
Posted

method(b); // which method? method(base) or method(derived)?

0

} public static void main(String args[]) { Base b = new Base(); Derived d = new Derived(); System.out.println(“test calls.”); test(b); test(d); } } Running the program gives an output of test calls. Base: In the base method… Derived: In the base method… See JLS section 15.11.4.4 and 15.11.3: “If class S contains a declaration for a method named m with the same descriptor (same number of parameters, the same parameter types, and the same return type) required by the method invocation as determined at compile time then this is the method to be invoked.” 7. (Sect.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123