java 纯面向对象和面向对象语言的区别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28672938/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 13:58:24  来源:igfitidea点击:

Difference between pure object oriented and object oriented language

javac++.netcoop

提问by Geek

What is difference between these two.I google it down but could not find the satisfied answer.For example java is a oop(Object oriented programming) but not pure oop(was written on some sites).Can anybody explain?

这两者之间有什么区别。我用谷歌搜索但找不到满意的答案。例如,java 是一个 oop(面向对象编程)但不是纯 oop(在某些网站上写的)。谁能解释一下?

回答by vvp

Java is oop but not pure because, There are Primitive data type in java like int, float etc. and they are not classes/Objects. This is only one reason that java is not Pure OOP. For example of Pure OOP . Objective C is Pure OOP language in which every thing is in the form of object.

Java 是 oop 但不是纯的,因为 Java 中有原始数据类型,如 int、float 等,它们不是类/对象。这只是 Java 不是纯 OOP 的一个原因。例如纯 OOP 。Objective C 是纯 OOP 语言,其中一切都以对象的形式存在。

回答by Paul Evans

Typically, in a pure OO language everythingaccessable in the language is an object (where even the classes that define objects can be object instances of meta-classes which in turn can be object instances of themselves). In Java and C++ there are basic language elements that aren't objects: most notably the primitive data types (or built-in types) such as int, float, charetc.

通常,在纯 OO 语言中,语言中可访问的所有内容都是对象(即使是定义对象的类也可以是元类的对象实例,而元类又可以是它们自身的对象实例)。在Java和C ++有基本语言元素不属于对象:最显着的基本数据类型(或内置类型),例如intfloatchar

回答by Paul Evans

In a purely object-oriented language, everything is an object. However, in object-oriented languages, you may have non-object variables (e.g. static variables).

在纯面向对象的语言中,一切都是对象。然而,在面向对象的语言中,您可能有非对象变量(例如静态变量)。