Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
How to swap variable values in Java ME using bitwise operations
How to swap variable values using bitwise operations.
Heres a sample code that swaps 2 variable values
The above code can be considered as much more optimized in terms of other swapping code it does not use any temp variables,secoundly it uses bitwise operators which also do internally require temp varibales to do the operation and thirdly it will be faster then the normal swap operations as bitwise operations are considered to be faster then other normal operations.