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 atoi in c++?
Explain the use of vtable.
What are stl algorithms?
In what situations do you have to use initialization list rather than assignment in constructors?
What is increment operator in c++?
What does enum stand for?
What is nested class in c++?
What is the use of :: operator in c++?
Define namespace.
What is a string example?
write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.
How does c++ sort work?
How can I improve my c++ skills?
Can class objects be passed as function arguments?
What is the full form nasa?