Forums Register Login

interesting questions....

+Pie Number of slices to send: Send
isnt String an object...so is String pass by value or pas by reference..and what about StringBuffer


and



+Pie Number of slices to send: Send
Strings are immutable. So m+="def"; creates a new String object. StringBuffer is mutable, so m.append("abc"); will modify the actual StringBuffer passed to the method...
+Pie Number of slices to send: Send
 

Ankur kothari wrote:isnt String an object...so is String pass by value or pas by reference..and what about StringBuffer


and





hey.... both String and StringBuffer are pass-by-value-of-reference.... if thats what you meant to ask.... you are right

refer : htts://javadude.com/articles/passbyvalue.htm
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 737 times.
Similar Threads
replacing characters
Converting from hex to decimal
what is the method capacity(); used??
Java Regular Expressions
same variable name for instance and local variable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:47:28.