6-Analyze and write a comparison of using C++ pointers and Java reference variables to refer to fixed heap-dynamic variables. Use safety and convenience as the primary considerations in the comparison. Write a report (7-15 lines)

Respuesta :

Answer:

Check the explanation

Explanation:

- C++ permits arithmetic among pointers but Java references not.

-java doesn’t support pointer explicitly, but Java uses pointer absolutely.

-Memory access via the pointer in C++ is basically unsafe but in java, robust security model does not allow arithmetic among pointers for this reason.

- References in Java are the strong types. Unlike c++ we cannot just cast int* to char* and just re-interpret the memory at that location.

-Manipulation of pointers is unsafe as compared to references in Java.