Results 1 to 2 of 2
Thread: String passing
- 12-21-2009, 04:56 AM #1
Member
- Join Date
- Oct 2009
- Posts
- 17
- Rep Power
- 0
- 12-21-2009, 05:32 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,716
- Rep Power
- 19
Strings in Sun's Tutorial might be worth reading.
I'm not aware of anything special to be aware of with regard to passing a reference to a string to a method. (or of return values). But remember that you use equals() to compare strings to see if they consist of the same characters in the same order. (== compares the reference values). And that strings are immutable - they will forever consist of the same characters they started with. So "str.toUpperCase()" won't convert str, instead you have to form a new string and assign it back to the variable with "str=str.toUpperCase()".
Similar Threads
-
Passing a value..
By Lagarto in forum New To JavaReplies: 3Last Post: 01-23-2011, 06:58 PM -
passing something
By dinosoep in forum Threads and SynchronizationReplies: 2Last Post: 12-05-2009, 10:26 AM -
The constructor Person(String, String, Date) is undefined
By fh84 in forum New To JavaReplies: 7Last Post: 11-03-2009, 03:18 AM -
how use string array while passing to a function
By sks9s9 in forum New To JavaReplies: 2Last Post: 02-03-2009, 01:44 PM -
Let eclipse warn about a semicolon after an if statement and string == string?
By foobar.fighter in forum EclipseReplies: 5Last Post: 01-11-2009, 11:12 AM
Bookmarks