摘要:
2.空指针异常:NullPointerException 情况一: int[] arr1 = new int[]{1,2,3}; arr1 = null; System.out.println(arr1[0]); 情况二: int[][] arr2 = new int[4][]; System.ou 阅读全文
posted @ 2021-01-31 22:17
pilipalala
阅读(249)
评论(0)
推荐(0)
摘要:
数组角标越界异常:ArrayIndexOutOfBoundsException int[] arr = new int[]{1,2,3,4,5}; 情况一:i <= arr.length,导致角标越界。应改为i < arr.length; for(int i = 0;i <= arr.length; 阅读全文
posted @ 2021-01-31 22:11
pilipalala
阅读(225)
评论(0)
推荐(0)
摘要:
阅读全文
posted @ 2021-01-31 21:41
pilipalala
阅读(52)
评论(0)
推荐(0)
摘要:
package com.atguigu.java; import java.util.Arrays; public class ArrayTest { public static void main(String[] args){ //1.boolean equals(int[] a,int[] b 阅读全文
posted @ 2021-01-31 21:33
pilipalala
阅读(74)
评论(0)
推荐(0)
摘要:
快速排序:面试前看,时间复杂度:nlog2n; 冒泡排序:时间复杂度:n2; 其他:面试前看; 阅读全文
posted @ 2021-01-31 13:49
pilipalala
阅读(52)
评论(0)
推荐(0)
摘要:
package com.atguigu.java; public class Bubblesort { public static void main(String[] args){ int arr[] = new int[]{-12,-52,52,24,65,94}; for(int i = 0; 阅读全文
posted @ 2021-01-31 13:05
pilipalala
阅读(74)
评论(0)
推荐(0)
摘要:
package com.atguigu.java; public class ArrayTest2 { public static void main(String[] args){ int[] arr1 = {-1,5,8,9,15,47,68,94}; //必须有序 int dest = 5; 阅读全文
posted @ 2021-01-31 00:49
pilipalala
阅读(56)
评论(0)
推荐(0)

浙公网安备 33010602011771号