COMPARATIVE ANALYSIS OF ENCAPSULATION IN JAVA AND PYTHON: SYNTAX AND IMPLEMENTATION DIFFERENCES

  • Skala Kamaran Omer *Computer Science and Engineering, University of Kurdistan Hewler, Kurdistan Region- Iraq
  • Star Dawood Mirkhan *Computer Science and Engineering, University of Kurdistan Hewler, Kurdistan Region- Iraq
  • Nyan Najat Hussein *Computer Science and Engineering, University of Kurdistan Hewler, Kurdistan Region- Iraq
  • Aveen Zuber Ali *Computer Science and Engineering, University of Kurdistan Hewler, Kurdistan Region- Iraq
  • Tarik Ahmed Rashid *Computer Science and Engineering, University of Kurdistan Hewler, Kurdistan Region- Iraq
  • HUSSEIN MOHAMMED ALI **Computer Engineering Department, Tishk International University, Kurdistan Region, Iraq
  • MAHMOOD YASHAR HAMZA **Computer Engineering Department, Tishk International University, Kurdistan Region, Iraq
  • POORNIMA NEDUNCHEZHIAN ***School of Computer Science and Engineering, Vellore Institute of Technology, Vellore- India
Keywords: Encapsulation; Java; Python; Object-oriented programming; Security

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

Download data is not yet available.

References

Khoirom, S., Sonia, M., Laikhuram, B., Laishram, J., & Singh, T. D. (2020). Comparative analysis of Python and Java for beginners. Int. Res. J. Eng. Technol, 7(8), 4384-4407.
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.
Published
2023-12-23
How to Cite
Omer, S. K., Mirkhan , S. D., Hussein, N. N., Ali, A. Z., Rashid, T. A., ALI, H. M., HAMZA, M. Y., & NEDUNCHEZHIAN, P. (2023). COMPARATIVE ANALYSIS OF ENCAPSULATION IN JAVA AND PYTHON: SYNTAX AND IMPLEMENTATION DIFFERENCES. Journal of Duhok University, 26(2), 379-389. https://doi.org/10.26682/csjuod.2023.26.2.35

Most read articles by the same author(s)