Morgan Stanley Interview Question

Reverse a Linked list. How is it different in Java than in C++?

Interview Answer

Anonymous

Oct 17, 2015

C++ you need to keep track of your pointers and objects created because you don't get a garbage collector, while Java you do. In Java, you simply de-reference your pointer to delete an object while in C++ doing the same thing can lead to a segfault.

2