as I know, Java always invoke a method by “pass-by-value”.
but I see the reference for Android’s NotificationManager.notify(String, int, Notification):
Returns
the id of the notification that is associated with the stringidentifier that can be used to cancel
the notification
please refer to the reference:
http://developer.android.com/reference/android/app/NotificationManager.html
How could this happend?
Is there something I mis-understand?
BR,
Henry
Seems like the API Reference for NotificationManager is a bit messed up.
Here’s the code as found via Google Code Search on NotificationManager and Android:
Obviously the parameter doesn’t return a value. They meant to have a similar JavaDoc but probably made a mistake.
Look at the code for the other variant of
notify:As you can see, this overloaded version just calls the primary implementation with a default
tagString value ofnull.Regarding the general question of passing by value and passing by reference, the simple/vulgarized explanation is:
Refer to the comments by arnivan and Patrick for clarification.