This is a very simple question from the point of view of programming, but since I am in the learning phase, I thought it was better to ask this question and not have a misunderstanding or narrow knowledge of this topic.
So excuse me if I messed it up somehow.
Question
Let's say I class A,B,C and Dnow class Ahave a piece of code that I need to have in class B,C and D, so I am expanding class Aintoclass B, class C, and class D
Now, how can I access the function class Ain other classes, I need to create an object class Aand access the function class Aor how to continue the extension Ain other classes, than I can call the function internally using this parameter.
If possible, I would really appreciate it if anyone could explain this concept with an example code that explains how logic flows.
Note
An example in Java, PHP and .Net would be appreciated.
source
share