Tagged articles
method overriding
19 articles · Page 1 of 1
This tutorial demonstrates how the super keyword lets a subclass invoke overridden methods and access shadowed fields in its superclass, providing step‑by‑step Java code examples, execution results, and explanations of the underlying inheritance mechanics.
InheritanceJavafield shadowing
0 likes · 5 min read

This article explains Java's two polymorphism mechanisms—static overload and dynamic override—detailing definitions, compiler rules, valid code examples, a side‑by‑side comparison table, and frequent pitfalls such as static method hiding, access‑modifier changes, and exception widening.
@OverrideJavaMethod Overloading
0 likes · 10 min read

This note explains Java inheritance, covering the single‑inheritance class hierarchy, a Car class example, a ChildCar subclass that adds a load field, and eight key inheritance capabilities such as member reuse, method overriding, and constructor chaining, illustrating why inheritance improves code reuse and quality.
Class HierarchyInheritanceJava
0 likes · 7 min read

This article shows how Go developers can achieve Java‑style method overriding by combining interfaces, struct embedding, and the functional‑options pattern, providing a flexible, decoupled way to customize behavior at compile‑time and run‑time without inheritance.
GoIdiomatic Gofunctional options
0 likes · 7 min read

The article shows how Go, which lacks inheritance and the @Override keyword, can achieve a clean override-like behavior by defining interfaces, using struct embedding to reuse functionality, and applying functional options for runtime customization, illustrated with a Dog‑Husky example.
CompositionGofunctional options
0 likes · 7 min read

This article explains the distinction between method overloading and method overriding in Java, covering their definitions, how the compiler or runtime selects the appropriate method, differences in method signatures, return types, and timing, and provides clear code examples for each concept.
JavaMethod OverloadingOOP
0 likes · 5 min read

This article explains Python's method overriding and how to use the super() function to extend parent behavior, then shows how to simulate method overloading with the multipledispatch library and @dispatch decorator, providing clear code examples and a concise comparison of the two concepts.
Method OverloadingOOPmethod overriding
0 likes · 6 min read

This article explains PHP's polymorphism—covering method overriding, simulated method overloading, interface polymorphism, traits, abstract classes, magic methods, and performance considerations—while providing clear code examples and discussing real‑world uses such as plugin systems, testing mocks, middleware, and strategy patterns.
OOPPHPPolymorphism
0 likes · 9 min read


21CTOApr 21, 2025 · Backend Development
This tutorial explains PHP inheritance concepts—including single, multi‑level, and hierarchical inheritance—showing how to reuse and extend code with practical examples of method overriding, the parent keyword, constructors, interfaces, and access modifiers.
Inheritancebackend developmentmethod overriding
0 likes · 10 min read

This article explains the core concept of polymorphism in object‑oriented programming, distinguishes compile‑time and runtime polymorphism, and provides ten practical Python examples—from animal sounds and shape drawing to payment processing, file handling, logging, and game characters—illustrating when and how to apply each technique.
Method OverloadingPolymorphismPython
0 likes · 9 min read

This article explains the purpose and proper use of PHP's final keyword for classes and methods, illustrating when and how to apply it with clear code examples to enhance code stability, security, and maintainability in object‑oriented development.
InheritanceOOPbackend development
0 likes · 8 min read

This article explains the concept of polymorphism in computer science, analyzes a non‑polymorphic PHP product class, demonstrates how inheritance and method overriding create a flexible, extensible design, and also covers static polymorphism via method overloading with illustrative code examples.
InheritanceMethod OverloadingOOP
0 likes · 8 min read

This article explains PHP's dispatch mechanism, showing how the runtime selects the appropriate method based on an object's actual class, and demonstrates polymorphism through a simple Animal‑Dog‑Cat example with complete code and output explanations.
DispatchOOPPHP
0 likes · 3 min read

This article explains Java polymorphism by illustrating inheritance hierarchies, runtime method binding, and the differences between static and dynamic dispatch, while providing concrete code examples that demonstrate how method overriding, field access, and down‑casting behave in practice.
InheritanceJavaOOP
0 likes · 6 min read

The article explains PHP class inheritance, detailing how public and protected properties and methods can be overridden in child classes while private members remain unaffected, and demonstrates correct overriding practices, parameter matching, and using the parent keyword with clear code examples.
BackendPHPmethod overriding
0 likes · 6 min read

This article explains the fundamentals of Python class inheritance, covering five typical ways to use parent class attributes and methods—including direct calls, super() for private members, method overriding, invoking __init__, and passing initialization parameters—accompanied by clear code examples.
InheritancePythonclass
0 likes · 6 min read

This article explains Java polymorphism—its definition, required conditions, and practical examples—including late binding, constructor behavior, and downcasting—illustrated with clear code snippets and analogies to help readers grasp how a single method call can produce different runtime results.
DowncastingInheritanceOOP
0 likes · 10 min read

This article explains Java inheritance, the use of extends, super and this keywords, protected members, method overriding, and constructor chaining, illustrating concepts with clear code examples and diagrams to show base and derived class relationships.
JavaOOPProtected
0 likes · 10 min read

This article explains the three core object‑oriented concepts, focuses on runtime polymorphism in Java, describes its required conditions, demonstrates implementation through inheritance and interfaces with detailed code examples, and analyzes classic method‑overloading scenarios.
JavaOOPmethod overriding
0 likes · 15 min read
