"Passing Data" Please respond to the following:

Computer Science
Tutor: None Selected Time limit: 1 Day

Explain the difference when you use these two (2) methods: passing an argument by value and passing data by reference. Provide an example of each type.

Jun 6th, 2015

undefined

Best explanation I ever heard of this.

Say I want to share a web page with you.

If I tell you the URL, I'm passing by reference. You can use that URL to see the same web page I can see. If that page is changed, we both see the changes. If you delete the URL, all you're doing is destroying your reference to that page - you're not deleting the actual page itself.

If I print out the page and give you the printout, I'm passing by value. Your page is a disconnected copy of the original. You won't see any subsequent changes, and any changes that you make (e.g. scribbling on your printout) will not show up on the original page. If you destroy the printout, you have actually destroyed your copy of the object - but the original web page remains intact.


undefined
Jun 6th, 2015

Are you studying on the go? Check out our FREE app and post questions on the fly!
Download on the
App Store
...
Jun 6th, 2015
...
Jun 6th, 2015
Dec 8th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer