*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes interesting questions.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "interesting questions...." Watch "interesting questions...." New topic
Author

interesting questions....

Ankur kothari
Ranch Hand

Joined: Sep 06, 2009
Posts: 531
isnt String an object...so is String pass by value or pas by reference..and what about StringBuffer


and



Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

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...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Kedar Sarmalkar
Greenhorn

Joined: May 25, 2007
Posts: 16
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: interesting questions....
 
Similar Threads
same variable name for instance and local variable
what is the method capacity(); used??
Java Regular Expressions
replacing characters
Converting from hex to decimal