Structural differences of constructor methods in object-oriented paradigms: a comparative study using C++, Java and Python / Jamal Othman ... [et al.] - Othman, Jamal; Mohamed Yusoff, Syarifah Adilah; Rosmani, Arifah Fasha; Abu Bakar, Mohd Saifulnizam (Unit Penerbitan JSKM, 2025)
Structure of a class in Object Oriented Programming involves the attributes and methods. The methods of a class normally consist of constructors, mutators, retrievers, processors and printers. Among these, constructor methods play a vital role in initializing objects and are essential in class construction within the Object-Oriented paradigm. Constructor method is the most important method in constructing a class. This article will compare the structure of constructor methods in three (3) different programming languages such as the C++, Java and Python, providing a clear comparison of how each language handles object initialization. These three programming languages support the Object-Oriented Paradigms. The comparative will be focusing on the syntaxes which are applied in each programming language to construct the constructor methods. Constructor methods can be categorized as default, normal and copy constructors and comparison of the three programming languages will be shown to compare the structure for each category of constructor methods. Understanding these differences is crucial for programmers who work with multiple languages and need to adapt their coding approaches accordingly.