Getting Started with Java
This is a 100% free course, but we need you to first join or login to watch this video.Alright, join or login here.
This video shows an example of call by value vs. call by reference in Java. It creates a method called modify() which is overloaded to accept an integer and a Square object. The method tries to modify both the integer and the Square object. While the original number passed while calling this method does not get altered, the original Square object changes its value.