Tagged articles
constructor
28 articles · Page 1 of 1
This tutorial explains how the super keyword invokes a superclass constructor—both no‑argument and parameterized—illustrates constructor chaining across inheritance hierarchies with concrete Java code examples, and highlights compilation errors when a matching superclass constructor is missing.
InheritanceJavaOOP
0 likes · 9 min read

The article explains Java's two‑phase object initialization, the seven‑step JVM process, static versus instance execution order, parent‑child class initialization rules, variable assignment lifecycle, and common pitfalls such as static forward references and constructor‑called overridden methods, all illustrated with concrete code examples.
InheritanceInterviewJVM
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 learning note walks through a complete Java Car class example, explaining its instance fields (brand, color, speed, id), a static count field, a parameterized constructor that auto‑increments the count, and accessor methods that illustrate core object‑oriented concepts.
Javaclassconstructor
0 likes · 4 min read

This tutorial walks through Java class fundamentals, covering class declarations, modifiers, member variables, methods, method overloading, and constructors with clear syntax examples and code snippets to help beginners write and understand Java classes.
JavaMethod OverloadingModifiers
0 likes · 8 min read

This article explains common constructor mistakes such as starting threads, calling overridable methods, and using too many parameters, demonstrates how the Builder pattern and default-value constructors can dramatically reduce boilerplate, improve readability and performance, and offers practical guidelines for safe constructor design.
Builder PatternJavacode refactoring
0 likes · 6 min read

This article explains the seven default special member functions that C++ automatically provides for a class—including constructors, destructors, copy/move operations and address‑of operators—showing when they are sufficient, when they can cause problems such as shallow copies or double frees, and how to implement custom versions to ensure correct resource management.
C++constructorcopy semantics
0 likes · 17 min read

This article explains the purpose, syntax, and practical examples of PHP constructors (__construct) and destructors (__destruct), demonstrating how they initialize objects, manage resources, and simplify code through automatic execution during object creation and destruction.
OOPPHPconstructor
0 likes · 8 min read

This article explains the role of Python's __init__ constructor in object‑oriented programming, demonstrates how it initializes object attributes with example code, and shows how other methods can access those initialized values.
OOPPythonclass
0 likes · 5 min read

This article explains how to define a PHP class with properties and methods, demonstrates traditional class syntax, introduces PHP 8.0 constructor property promotion for more concise initialization, shows how to set default values, and outlines the benefits of using this feature.
ClassesPHPProperty Promotion
0 likes · 5 min read

The article thoroughly explains JavaScript constructors, prototype chains, the this binding, and ES6 class syntax, showing how functions become constructors with new, how prototypes link objects, custom new/instanceof implementations, and various inheritance patterns—including parasitic combination inheritance realized by class extends and super.
ES6InheritanceJavaScript
0 likes · 22 min read

This article explains the purpose and behavior of Python's __init__ constructor method, clarifies object-oriented concepts such as classes, instances, and attributes, and provides example code illustrating how __init__ is automatically invoked during object creation to initialize instance properties.
OOPPythonconstructor
0 likes · 4 min read

This article explains PHP's limited inheritance concept, detailing how subclasses inherit public and protected members but not private ones, and covers protected inheritance, static members, and the inheritance of constructors and destructors, illustrated with clear code examples.
InheritanceOOPProtected
0 likes · 5 min read

This article explains six fundamental JavaScript design patterns—Constructor, Facade, Proxy, Strategy, Bridge, and State—illustrating their concepts, advantages, drawbacks, and providing clear code examples that demonstrate how each pattern can improve code organization, reuse, and maintainability in front‑end development.
FacadeProxyState
0 likes · 23 min read

The article explains a Groovy runtime initialization error caused by the language treating both double‑quoted and single‑quoted literals as Strings rather than chars, leading to a mismatched enum constructor, and provides a corrected enum definition with explicit char casting to resolve the issue.
EnumGroovyJava
0 likes · 6 min read

The article explains why having constructors perform excessive work is a design flaw, describes how to spot this problem through code symptoms, discusses its impact on testability and maintainability, and provides concrete refactoring strategies such as dependency injection, factories, and builder patterns.
Design Principlescode smellconstructor
0 likes · 13 min read

This article provides a thorough overview of JavaScript inheritance mechanisms—including prototype chain, constructor stealing, combination, parasitic, and ES6 class inheritance—detailing their implementations, advantages, drawbacks, and practical usage with clear code examples and best‑practice recommendations.
ES5ES6Inheritance
0 likes · 12 min read

The article examines Java performance optimization by profiling constructor initialization, individual setter calls, and Lombok's builder pattern, showing that direct constructor usage consistently outperforms setters and builders, and provides practical coding tips for faster Java applications.
Builderconstructorprofiling
0 likes · 4 min read

This article compares Java and Solidity constructor concepts, shows how Solidity constructors were defined before and after version 0.4.22, demonstrates the required syntax changes with code examples, and explains the compilation warnings and errors that arise from version mismatches.
BlockchainJavaSmart Contracts
0 likes · 4 min read

This article explains how Java objects are initialized using explicit values, default values, and constructors, describes the characteristics and purpose of constructors, demonstrates their syntax with code examples, and introduces method overloading with practical illustrations.
InitializationJavaMethod Overloading
0 likes · 7 min read

This article explains Java's reflection mechanism, covering how to obtain Class objects, inspect constructors, fields, and methods, invoke them dynamically, run main methods via reflection, use configuration files for flexible execution, and bypass generic type checks with reflective calls.
Javaconstructormethod
0 likes · 21 min read

This article explores JavaScript's various techniques for determining variable types—including typeof, instanceof, constructor, Object.prototype.toString.call, and jQuery's $.type—by explaining their behavior, limitations, and practical examples with common data types.
Object.prototype.toStringTypeOfconstructor
0 likes · 8 min read

This article explains Java's reflection mechanism, showing how to acquire Class objects, dynamically load classes, and comprehensively analyze a class's methods, fields, and constructors—including retrieving method return types, parameter lists, accessing private fields, and creating instances at runtime.
Javaconstructor
0 likes · 14 min read

This article explains Java's reflection mechanism, showing how to obtain Class objects, dynamically load classes, and retrieve information about methods, fields, and constructors, accompanied by practical code examples that demonstrate inspecting and invoking members at runtime.
Javaconstructor
0 likes · 7 min read

A whimsical tale follows the Java Prince as he explores the JavaScript kingdom, discovering how objects are created without classes, how inheritance works via prototypes, and how constructor functions and syntactic sugar bring familiar class‑like patterns to a prototype‑based language.
Inheritanceconstructorobject-oriented
0 likes · 10 min read

This article explains Kotlin class declarations, covering primary and secondary constructors, visibility modifiers, and special class types such as enums, sealed classes, and data classes, with code examples illustrating each concept.
Enumclassconstructor
0 likes · 7 min read

This article provides a comprehensive guide to JavaScript functions, covering basic definitions, anonymous functions, default parameters, the arguments object, IIFE, nested functions, constructor functions, and best practices for using the new keyword, all illustrated with clear code examples.
Anonymous FunctionsDefault ParametersIIFE
0 likes · 13 min read

This article examines the Java constructor execution sequence, detailing how class initialization proceeds from zeroed memory allocation through static and instance variable initialization, parent constructor invocation, and finally the subclass constructor, illustrated with sample code and explanatory comments.
Initializationconstructor
0 likes · 4 min read
