Shahriyar716
جمعه 26 فروردین 1390, 15:36 عصر
سلام به همه دوستان
چطور می شه یک تابع رو با فرستادن آدرس متغیر ها به آن صدا زد؟ (فراخوانی با ارجاع، نه با مقدار)
dr_jacky_2005
یک شنبه 28 فروردین 1390, 09:56 صبح
سلام به همه دوستان
چطور می شه یک تابع رو با فرستادن آدرس متغیر ها به آن صدا زد؟ (فراخوانی با ارجاع، نه با مقدار)
When you call a method by reference, the callee sees the caller’s original variables passed as parameters, not copies. References to the callee’s objects are treated the same way. Thus any changes the callee makes to the caller’s variables affect the caller’s original variables. Java never uses call by reference. Java always uses call by value
منبع:
http://mindprod.com/jgloss/callbyreference.html
____________
توضیح خیلی شفاف تر :
http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.