When I first entered the world of java, I found that it was so beautiful. It's still a long journey. I hope everyone can continue. For the first time I wrote a blog, I would like to give you some advice on some shortcomings.
650) this. width = 650; "src ="/e/u/themes/default/images/spacer.gif "style =" border: 1px solid # ddd; "alt =" spacer.gif "/>
class Test10{ public static void main(String[] args) { int[] array = {1, 2}; System.out.println("Before for swap: " + array[0] + " " + array[1]); swap(array[0], array[1]); System.out.println("after for swap: " + array[0] + " " + array[1]); System.out.println("Before for swap: " + array[0] + " " + array[1]); swapFirstTwoInArray(array); System.out.println("after for swap: " + array[0] + " " + array[1]); } public static void swap(int n1, int n2) { int temp = n1; n1 = n2; n2 = n1; } public static void swapFirstTwoInArray(int[] array) { int temp = array[0]; array[0] = array[1]; array[1] = temp; }}
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/151A44V0-0.jpg "title =" 8g?tympm=?so=g=l5tce4l4.jpg "alt =" 163478169.jpg"/>
This article from the "codenong" blog, please be sure to keep this source http://yw1994.blog.51cto.com/7621136/1298271