Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Can one create a method which gets a String and modifies it?
Can one create a method which gets a String and modifies it?
✍: Guest
No. In Java, Strings are constant or immutable; their values cannot be changed after they are created, but they can be shared. Once you change a string, you actually create a new object. For example:
String s = "abc"; //create a new String object representing "abc"
s = s.toUpperCase(); //create another object representing "ABC"
2012-08-24, 2417👍, 0💬
Popular Posts:
What's the difference between J2SDK 1.5 and J2SDK 5.0? There is no difference, Sun Microsystems just...
How do you override a defined macro? You can use the #undef preprocessor directive to undefine (over...
How can I include comments in HTML? An HTML comment begins with "<!--", ends with "-->...
What will happen in these three cases? if (a=0) { //somecode } if (a==0) { //do something } if (a===...
How To Return the Second 5 Rows? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If yo...