Monday, October 10, 2011

What happens If the argument you want to pass Is an object Instead of II primitive?

You'll learn more about this In later chapters,but you already know the answer.Java passes
everything by value. EverythIng. But...value means bits Inside the vcrtable. And remem ber,you don't
stuff objects Into variables; the variable Is a remote control-a reference to an object. SoIf you pass a
reference to an object into a method, you're passing a copy of the remote control.

No comments:

Post a Comment