In Java, all objects are passed by reference, whereas in C++, the default behavior is to pass objects by value.
- from Programming Interviews Exposed: Secrets to Landing Your Next Job, 3rd Edition
- Publisher: Wrox
- Released: November 2012
This is often asked in phone interviews. Java is always by reference. C++ is by value but you can pass in by reference using the reference operator.
Share this highlighthttp://www.safaribooksonline.com/a/programming-interviews-exposed/1733/