I read about small talk being completely object oriented.. is C++ also completely object oriented? if no.. then why so??
相关问题
- how to define constructor for Python's new Nam
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Keeping track of variable instances
- Why does const allow implicit conversion of refere
相关文章
- 接口B继承接口A,但是又不添加新的方法。这样有什么意义吗?
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
Define OOL. If you mean using classes etc, then C++ supports OO-style of programming among others. There's nothing that stops you from not using classes. Java OTOH, does not allow for but classes. (Yes, I do know Java supports FP.)
No, it isn't. You can write a valid, well-coded, excellently-styled C++ program without using an object even once.
C++ supports object-oriented programming, but OO is not intrinsic to the language. In fact, the main function isn't a member of an object.
In smalltalk or Java, you can't tie your shoes (or write "Hello, world") without at least one class.
(Of course, one can argue about Java being a completely object-oriented language too, because its primitives (say, int) are not objects.)
The big arguments people have against declaring C++ as "pure" OO is that it still requires at least one non-OO bit,
main()
, and that not everything is an object (int
,long
et al).It also exposes the state of an object for manipulation without using the message-passing paradigm (public members). This breaks the encapsulation of objects.
Java, on the other hand, has
main()
as just a static method of a class so it's closer but it still has non-object things in it.Smalltalk is the lingua franca normally held up as the purest of the pure, but I don't know enough about it to comment.
Me, I tend to leave those sort of arguments for the intelligentsia while I get on with developing code and delivering to my clients :-)
of course not!! It supports intrinsic data types.