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
Can you pass a vector to a function?
What is split a string in c++?
What is a sequence in c++?
What is microsoft c++ redistributable 2013?
What is the point of polymorphism?
Explain overriding.
Is c++ an integer?
What is a v-table?
what is graphics
What is functions syntax in c++?
Can non graphic characters be used and processed in C++?
c++ program to swap the objects of two different classes
Why Pointers are not used in C++?
What is the difference between Stack and Queue in C++?
Explain the FOR loop with a help of a code.