If static methods can’t be overridden, how its working here (For Java)?
First of all there are different mechanisms involved here: Overriding and Shadowing (also called hiding). 1) Static methods cannot be overriden as they are attached to the class they are defined in. However, you can shadow/hide a static method as you are doing with your Parent/Child class. This means, the method gets replaced in the … Read more