摘 要: Java与Python作为两种主流的不同类型的面向对象编程语言,有较深的研究价值。本文简述并比较了面 向对象编程语言的继承与多态,Java因只支持单继承而与Python等系列语言不同,因此Java通过设计接口以间接实现 多继承。另一方面,本文阐述了垃圾回收机制的意义、两种回收方法和主GC的触发条件,并与Python进行了对比,最 后进行了Java内存的概况和结构分析。 |
关键词: 面向对象编程;Java与Python;继承与多态;接口;垃圾回收机制 |
中图分类号: TP312
文献标识码: A
|
基金项目: 中央高校基本科研业务费专项资金资助(supported by "the Fundamental Research Funds for the Central Universities"). |
|
Research on the Basic Characteristics of Object-Oriented Programming Based on Java and Python |
HAN Hongfeng,FENG Shi,LUO Yilong
|
( Beijing University of Posts and Telecommunications, Beijing 100876, China)
|
Abstract: Java and Python are two kinds of mainstream object oriented programming languages with comparatively higher research value.This paper sketches and compares the two major features of object oriented programming languages:inheritance and polymorphism.Different from Python and other programming languages,Java only supports single inheritance of classes,so Java indirectly implements multiple inheritance through the design interface.This paper also states the significance of the garbage collection mechanism,two kinds of recovery methods and the trigger condition of the main GC of Java,and then compares with Python.At last,the general situation and structure analysis of Java memory are carried out. |
Keywords: object oriented programming;Java and Python;inheritance and polymorphism;interface;garbage collection mechanism |