面向过程: 当需要实现一个功能的时候,每一个具体的步骤都要亲力亲为,详细处理每一个细节.
面向对象: 当需要实现一个功能的时候,不关心具体的步骤,而是找一个已经具有该功能的人,来帮我做事儿.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| package xiaochenyan.top.banji;
import java.util.Arrays;
public class Student { public static void main(String[] args) { int[] array = {1,23,4,15,51,2,52,23};
System.out.print("["); for(int i = 0;i < array.length;i++) { if(i == array.length - 1) { System.out.println(array[i] + "]"); }else{ System.out.print(array[i] + ", "); } } System.out.println("======================");
System.out.println(Arrays.toString(array)); } }
|