This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am trying to enter a string then output should be the string ordered suppose you enter CDAB output should be ABCD my code is not sorting the string ??
my code is as follows
Compiling 1 source file to C:\Documents and Settings\Moon\My Documents\NetBeansProjects\order1\build\classes compile: run: Enter Your Name : CADH Name after reordering is:CADH BUILD SUCCESSFUL (total time: 12 seconds)
[HENRY: Added Code Tags] [ August 08, 2008: Message edited by: Henry Wong ]
Look up the terms "call by reference" and "call by value". Youcould be a C programmer because your code assumes the method is called by reference. To use your method logic, you'll have to pass the full string to the method along with the indexes of the chars to be swapped. Then build and return a new string with those chars swapped.
Joined: Jul 26, 2008
How to fix the problem if I can not pass by reference. Can you guide me please?