thanks for asking! Java is *strictly* pass-by-value itseems read the below article... http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html or try http://www.google.co.in/search?q=java+pass+by+value+and+pass+by+reference serach in google..."java pass by value and pass by reference"
On Wed, Apr 22, 2009 at 2:28 PM, CIA <[email protected]> wrote: > public static void main(String[] args) { > int a = 8; > int b = 5; > System.out.println("Before: a = " + a + ", b = " + b); > swap(a, b); > System.out.println("After: a = " + a + ", b = " + b); > } > > Both After and Before, a = 8, b = 5 > > Can anyone help me to create *swap* method to solve my problem? > Thanks! :) > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
