对象和原始对象之间的性能和设计差异

2024-05-19 01:35:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我觉得大多数语言都倾向于用ruby和dart之类的“一切都是对象”这样的语句来证明它们是面向对象的

另一方面,像这样的语句(Java完全引用)

The primitive types represent single values—not complex objects. Although Java is otherwise completely object-oriented, the primitive types are not. They are analogous to the simple types found in most other non–object-oriented languages. The reason for this is efficiency. Making the primitive types into objects would have degraded performance too much.

那么为什么其他语言将原语实现为对象呢


Tags: the对象语言objectsobjectisnot语句

热门问题