In one of the courses for studying JAVA heard the phrase:
"In the class of the heir, you can add fields and methods, thereby expanding the capabilities of the base class."
I understood this phrase so that if a method is declared in the class of the heir, then the method of the heir will be counted as the method of the parent class. This type of money box is obtained. But in fact, it does not work, it means I misunderstood. Explain where I am wrong.
public class Mother { void callSun(){ System.out.println("Игорь! Иди ко мне!"); } public class Sun extends Mother { void searchMother (){ System.out.println("Мама!!!"); } With instances of classes in hand, in the above code, the class Sun (heir) can use both its own method and the method of class Mother (parent), and the parent can no longer use the method of heir. Which is completely contrary to how I understood the quote.