Answer Posted / shrikant kale
I think the answer to this is very interesting.
For one, I believe that in Java all objects are on the
heap, and while you don't have pointers, you do
have "References". References have copy symantics and java
internally keeps track of reference counts so that it's
garbage collector knows whats safe to get rid of.
Since you only access objects through copyable references,
the actual number of times you need to copy an object is
greatly reduced (for example, in C++ just passing an object
to a function (by value) results in new objects being copy
constructed, in Java only the reference to the object is
passed). The designers probably figured that clone() would
be enough for the remaining uses.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is a manipulator in c++?
Define what is constructor?
What is the use of string in c++?
What is the benefit of learning c++?
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
What are containers in c++?
Is abstract thinking intelligence?
What is c++ course?
What is data type in c++?
What is null pointer and void pointer and what is their use?
Can a constructor be private?
What do you mean by volatile and mutable keywords used in c++?
What do you mean by inheritance in c++? Explain its types.
Why is c++ difficult?
What things would you remember while making an interface?