Describe pass by reference. You have a program with a method changeMe() that takes a string. In the main method, a string is set to "Hello" and it is passed to changeMe(). The changeMe() method sets the string to "I'm changed". In the main method, after call to changeMe(), there is a print statement for the string. What is printed?
Anonymous
Even if the changeMe() method try to change the passed object, it will not change it. When you print the value in Main method it will still print Hello because String in immutable. When changeMe() method changes the passed value a new object will get created.
Check out your Company Bowl for anonymous work chats.