COMPARATIVE ANALYSIS OF ENCAPSULATION IN JAVA AND PYTHON: SYNTAX AND IMPLEMENTATION DIFFERENCES
Abstract
Encapsulation is a fundamental principle of object-oriented programming, which allows for the hiding of implementation details and the protection of data from unauthorized access. This paper evaluates the concept of encapsulation in the programming languages Java and Python. The study examines the ways in which encapsulation is implemented in each language, including access modifiers and methods of data hiding. This research paper’s findings demonstrate that while both languages support encapsulation, the syntax and specific implementation vary in each of them. In particular, Java's use of access modifiers such as private, protected and public allows for a stricter level of encapsulation compared to Python's use of the '_' and '__' prefix to denote private variables and methods.
Downloads
References
Ma, K. K., & Foster, J. S. (2007). Inferring aliasing and encapsulation properties for Java. ACM SIGPLAN Notices, 42(10), 423-440.
Johnson, B., & Chandran, A. S. (2021). ‘Comparison between Python, Java and R progrmming language in machine learning. Int. Res. J. Modernization Eng. Technol. Sci, 3(6), 1-6.
Skoglund, M. (2003). Practical Use of Encapsulation in Object-Oriented Programming. In Software Engineering Research and Practice (pp. 554-560).
Cramer, T., Friedman, R., Miller, T., Seberger, D., Wilson, R., & Wolczko, M. (1997). Compiling Java just in time. Ieee micro, 17(3), 36-43.
Menzies, T., & Haynes, P. (1996). Empirical observations of class-level encapsulation and inheritance. Technical report, Department of Software Development, Monash University. (7)
Elish, M. O., & Offutt, J. (2002). The adherence of open source Java programmers to standard coding practices.
Fleury, A. E. (2001). Encapsualtion and reuse as viewed by java students. ACM SIGCSE Bulletin, 33(1), 189-193.
Eustace, K., & Hay, L. (2000, December). A community and knowledge building model in computer education. In Proceedings of the Australasian conference on Computing education (pp. 95-102).
Snyder, A. (1986, June). Encapsulation and inheritance in object-oriented programming languages. In Conference proceedings on Object-oriented programming systems, languages and applications (pp. 38-45).
Kölling, M. (1999). The problem of teaching object-oriented programming, Part 1: Languages. Journal of Object-oriented programming, 11(8), 8-15. (12)
Nilsen, K. (2007, September). Improving abstraction, encapsulation, and performance within mixed-mode real-time Java applications. In Proceedings of the 5th international workshop on Java technologies for real-time and embedded systems (pp. 13-22).
Kniesel, G., & Theisen, D. (2001). JAC—access right based encapsulation for Java. Software: Practice and Experience, 31(6), 555-576.
It is the policy of the Journal of Duhok University to own the copyright of the technical contributions. It publishes and facilitates the appropriate re-utilize of the published materials by others. Photocopying is permitted with credit and referring to the source for individuals use.
Copyright © 2017. All Rights Reserved.