【原】Java学习笔记012 - 数组
 package cn.temptation;
 public class Sample01 {
     public static void main(String[] args) {
         // 需求:小店对自己的销售额按季度进行统计,2016年各个季度统计如下:
         //         第1季度:1月---10k    2月---12k    3月---9k
         //         第2季度:4月---10k    5月---12k    6月---9k
         //         第3季度:7月---10k    8月---12k    9月---9k
         //         第4季度:10月---10k    11月---12k    12月---9k
         // 考虑使用合适的数据类型来存储数据,因为每个季度中的每个月都记录下来的是其销售额,所以每个月记录的都是相同意义的数据
         // 考虑使用数组存储
         // 第1季度:int[] sale1 = { 10, 12, 9 };
         // 第2季度:int[] sale2 = { 10, 12, 9 };
         // 第3季度:int[] sale3 = { 10, 12, 9 };
         // 第4季度:int[] sale4 = { 10, 12, 9 };
         // 数组是一个容器,既然是容器,那么容器中存放元素的空间(即在堆内存开辟出来的空间)是否可以存储使用者指定类型的元素?
         // 前面看到在空间中存储基本数据类型的数据是可以的,那么是否可以存储引用数据类型的数组呢?        答:可以的
         // 类比:家里的冰箱是一个容器,冰箱里可以存放若干个小的容器冰格(大容器里可以放小容器)
         // 二维数组的概念:元素为一维数组的(一维)数组
         // 二维数组定义及初始化的形式1(动态初始化)
         // 数据类型[][]   数组名      =  new    数据类型[m][n];
         // m:表示该二维数组有多少个一维数组
         // n:表示每一个一维数组有多少个元素
         int[][] yearSale = new int[4][3];
         // 显示出的  [[ 表示是二维数组,  类比 显示出 [ 表示是一维数组
         System.out.println(yearSale);            // [[I@15db9742
         System.out.println("------------------------------");
         // yearSale[0]表示取得yearSale这个二维数组的第一个元素,也就是一个一维数组
         System.out.println(yearSale[0]);        // [I@6d06d69c
         System.out.println(yearSale[1]);        // [I@7852e922
         System.out.println(yearSale[2]);        // [I@4e25154f
         System.out.println(yearSale[3]);        // [I@70dea4e
         System.out.println("------------------------------");
         // 以yearSale[0]作为一个整体来看,yearSale[0][0]表示这个整体(一个一维数组)的第1个元素
         System.out.println(yearSale[0][0]);        //
         System.out.println(yearSale[0][1]);        //
         System.out.println(yearSale[0][2]);        //
     }
 }
 package cn.temptation;
 public class Sample02 {
     public static void main(String[] args) {
         // 一维数组定义有两种形式
 //        int[] arr1 = new int[3];    // 要求使用这种写法
 //        int arr2[] = new int[3];
         // 二维数组定义形式1(要求使用这种写法)
         int[][] yearSale1 = new int[4][3];
         // 二维数组定义形式2(语法可以,但是不要这样写)
         int yearSale2[][] = new int[4][3];
         // 二维数组定义形式3(等你面试别人的时候问别人)
         int[] yearSale3[] = new int[4][3];
         System.out.println(yearSale1);        // [[I@15db9742
         System.out.println(yearSale2);        // [[I@6d06d69c
         System.out.println(yearSale3);        // [[I@7852e922
         // 问题:请说明下面变量的类型
         int[] i, j[];
         // 还是那句话"把没有见过的问题向见过的问题进行转换"
         // 类比 int i, j;    等价于    int i;    int j;
         // 所以上面的语句按此推理应该等价于        int[] i;    int[] j[];
         // 推理之后还是应该验证一下
 //        // The local variable i may not have been initialized
 //        System.out.println(i);        // 使用eclipse自动判定一下i的类型,为一维数组
 //        // The local variable j may not have been initialized
 //        System.out.println(    j);        // 使用eclipse自动判定一下j的类型,为二维数组
     }
 }
 package cn.temptation;
 public class Sample03 {
     public static void main(String[] args) {
         // 需求:小店对自己的销售额按季度进行统计,2016年各个季度统计如下:(3月初开店,11月底倒闭)
         //         第1季度:3月---9k
         //         第2季度:4月---10k    5月---12k    6月---9k
         //         第3季度:7月---10k    8月---12k    9月---9k
         //         第4季度:10月---10k    11月---12k
         // 单纯从存储的角度看,下面这个二维数组是可以存储的(语法上OK)
         // 但是会在元素数据的语义上有歧义,到底是这个月没有开张或是倒闭,还是这个月的销售额就是0
 //        int[][] yearSale = new int[4][3];
         // 用上述语句进行数据存储时,不但需要知道二维数组中有多少个一级元素,而且还需要知道一级元素的最大长度是多少,否则会发生存储不下的问题
         // 二维数组定义及初始化的形式2(动态初始化)
         // 数据类型[][]   数组名    =  new  数据类型[m][];
         // m:表示该二维数组有多少个一维数组
         int[][] yearSale = new int[4][];
         // 上述语句说明了三件事:
         // 1、这个变量的类型是一个二维int数组
         // 2、这个二维数组的元素是一维数组类型
         // 3、该二维数组的一级元素有4个一维数组组成
         System.out.println(yearSale);            // [[I@15db9742
         System.out.println(yearSale[0]);        // null
         System.out.println(yearSale[1]);        // null
         System.out.println(yearSale[2]);        // null
         System.out.println(yearSale[3]);        // null
         // 引用数据类型的默认值为 null
         // 上述语句中new int[4][]这句话,说明了在内存的堆中开辟空间做存储,只说明开辟出4个长度的空间,至于空间里放东西(存放数据)这个事情还没做
         // 只知道向空间里放的东西(存放的数据)的类型是int类型的一维数组
         // 使用二维数组定义及初始化的形式2(动态初始化)这种形式需要在二维数组定义及初始化后,还需要对二维数组的一级元素进行初始化
         yearSale[0] = new int[1];
         // 为什么非要放一个一维数组?可以放一个基本数据类型的数据不?            答:不行
         // Type mismatch: cannot convert from int to int[]
 //        yearSale[0] = 123;
         // 侧面证明了 Java语言 是 强类型语言(使用时的随意性得到约束),语法上严格的类型要求可以避免使用上的错误产生
         yearSale[1] = new int[3];
         yearSale[2] = new int[3];
         yearSale[3] = new int[2];
         System.out.println(yearSale[0]);        // [I@6d06d69c
         System.out.println(yearSale[1]);        // [I@7852e922
         System.out.println(yearSale[2]);        // [I@4e25154f
         System.out.println(yearSale[3]);        // [I@70dea4e
         System.out.println(yearSale[3][0]);        //
         System.out.println(yearSale[3][1]);        // 0
         // 产生异常:java.lang.ArrayIndexOutOfBoundsException: 1
 //        System.out.println(yearSale[0][1]);
         // 如下写法可以不可以?
         // 语法错误:Cannot specify an array dimension after an empty dimension        不能在一个空的维数后定义一个数组维数
         // 这个语法错误可以理解为:第一个中括号中的数字表示的是这个二维数组有多少个一维数组
         //        第一个中括号中没有数字也就是不知道有多少个一维数组(一级元素),在不知道的情况下就要去给每个一级元素开辟3个长度的空间,如何开辟?编译器做不到
 //        int[][] arr = new int[][3];
     }
 }
 package cn.temptation;
 public class Sample04 {
     public static void main(String[] args) {
         // 二维数组定义及初始化的形式3(静态初始化)
         // 简写形式
         // 数据类型[][]   数组名     =  {
         //                                { 二维数组的元素1的元素1, 二维数组的元素1的元素2, ..., 二维数组的元素1的元素n },
         //                                { 二维数组的元素2的元素1, 二维数组的元素2的元素2, ..., 二维数组的元素2的元素n },...
         //                                { 二维数组的元素m的元素1, 二维数组的元素m的元素2, ..., 二维数组的元素m的元素n },
         //                            };
         // m:表示该二维数组有多少个一维数组
         // n:表示每个一维数组有多少个元素
         // 注意:作为这种形式的二维数组的元素(一维数组)的长度可以一致,也可以不一致
         int[][] yearSale = { { 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 }};
         System.out.println(yearSale);        // [[I@15db9742
         int[][] scoreArr = { { 50 }, { 10, 20, 30 }, { 60, 70 } };
         System.out.println(scoreArr);        // [[I@6d06d69c
         // 完整形式
         // 数据类型[][]   数组名     =  new 数据类型[][] {
         //                                { 二维数组的元素1的元素1, 二维数组的元素1的元素2, ..., 二维数组的元素1的元素n },
         //                                { 二维数组的元素2的元素1, 二维数组的元素2的元素2, ..., 二维数组的元素2的元素n },...
         //                                { 二维数组的元素m的元素1, 二维数组的元素m的元素2, ..., 二维数组的元素m的元素n },
         //                            };
         // m:表示该二维数组有多少个一维数组
         // n:表示每个一维数组有多少个元素
         // 注意:作为这种形式的二维数组的元素(一维数组)的长度可以一致,也可以不一致
         int[][] yearSaleEx = new int[][] { { 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 }};
         System.out.println(yearSaleEx);        // [[I@7852e922
         int[][] scoreArrEx = { { 50 }, { 10, 20, 30 }, { 60, 70 } };
         System.out.println(scoreArrEx);        // [[I@4e25154f
         System.out.println(scoreArr[0]);    // [I@70dea4e
         System.out.println(scoreArr[1]);    // [I@5c647e05
         System.out.println(scoreArr[2]);    // [I@33909752
         System.out.println(scoreArr[0][0]);        //
     }
 }
 package cn.temptation;
 public class Sample05 {
     public static void main(String[] args) {
         // 二维数组的遍历
         int[][] yearSale = { { 10, 20, 30 }, { 40, 50, 60 }, { 70, 80, 90 }, { 77, 88, 99 } };
         // 类比一维数组的遍历
         // 这里二维数组的length属性表示二维数组包含的元素(一维数组)的个数
         System.out.println(yearSale.length);        // 4
         // 最简单的思路
 //        for (int i = 0; i < yearSale[0].length; i++) {
 //            System.out.println(yearSale[0][i]);
 //        }
 //        for (int i = 0; i < yearSale[1].length; i++) {
 //            System.out.println(yearSale[1][i]);
 //        }
 //        for (int i = 0; i < yearSale[2].length; i++) {
 //            System.out.println(yearSale[2][i]);
 //        }
 //        for (int i = 0; i < yearSale[3].length; i++) {
 //            System.out.println(yearSale[3][i]);
 //        }
         // 因为又发现重复的执行,考虑使用循环
 //        for (int i = 0; i < yearSale.length; i++) {
 //            for (int j = 0; j < yearSale[i].length; j++) {
 //                System.out.println(yearSale[i][j]);
 //            }
 //        }
         // 调用方法
         printArray(yearSale);
     }
     // 需求:制作一个二维数组的打印方法printArray,显示例如:[[10, 20, 30], [40, 50, 60], [70, 80, 90], [77, 88, 99]]
     // 写法1、在一个方法中打印显示
     /**
      * 二维数组打印方法
      * @param yearSale:二维数组
      */
 //    public static void printArray(int[][] arr) {
 //        System.out.print("[");
 //
 //        // 遍历二维数组
 //        for (int i = 0; i < arr.length; i++) {
 //            if (i == arr.length - 1) {        // 二维数组的最后一个元素 加上"]"
 //                // 遍历一维数组
 //                System.out.print("[");
 //
 //                for (int j = 0; j < arr[i].length; j++) {
 //                    if (j == arr[i].length - 1) {        // 一维数组的最后一个元素 加上"]"
 //                        System.out.print(arr[i][j] + "]");
 //                    } else {                // 一维数组的其他元素 加上","
 //                        System.out.print(arr[i][j] + ",");
 //                    }
 //                }
 //
 //                // 二维数组的最后一个元素 加上"]"
 //                System.out.print("]");
 //            } else {                // 二维数组的其他元素 加上","
 //                // 遍历一维数组
 //                System.out.print("[");
 //
 //                for (int j = 0; j < arr[i].length; j++) {
 //                    if (j == arr[i].length - 1) {        // 一维数组的最后一个元素 加上"]"
 //                        System.out.print(arr[i][j] + "]");
 //                    } else {                // 一维数组的其他元素 加上","
 //                        System.out.print(arr[i][j] + ",");
 //                    }
 //                }
 //
 //                // 二维数组的其他元素 加上","
 //                System.out.print(",");
 //            }
 //        }
 //
 //        // 换行
 //        System.out.println();
 //    }
     // 写法2、不同的事情在不同的方法中做
     /**
      * 二维数组的打印方法
      * @param arr:二维数组
      */
     public static void printArray(int[][] arr) {
         System.out.print("[");
         // 遍历二维数组
         for (int i = 0; i < arr.length; i++) {
             // 1、调用一维数组的打印方法
             printArray(arr[i]);
             // 2、打印完一维数组后,添加不同的后续内容
             if (i == arr.length - 1) {    // 二维数组的最后一个元素 加上"]"
                 System.out.print("]");
             } else {                    // 二维数组的最后一个元素 加上","
                 System.out.print(",");
             }
         }
         // 换行
         System.out.println();
     }
     /**
      * 一维数组的打印方法
      * @param arr:一维数组
      */
     public static void printArray(int[] arr) {
         System.out.print("[");
         // 遍历数组
         for (int i = 0; i < arr.length; i++) {
             if (i == arr.length - 1) {    // 一维数组的最后一个元素 加上"]"
                 System.out.print(arr[i] + "]");
             } else {                    // 一维数组的最后一个元素 加上","
                 System.out.print(arr[i] + ",");
             }
         }
     }
 }
 package cn.temptation;
 public class Sample06 {
     public static void main(String[] args) {
         // 需求:小店对自己的销售额按季度进行统计,2016年各个季度统计如下:(3月初开店,11月底倒闭)
         //         第1季度:3月---4k
         //         第2季度:4月---10k    5月---12k    6月---9k
         //         第3季度:7月---10k    8月---19k    9月---9k
         //         第4季度:10月---10k    11月---12k
         // 使用二维数组计算2016年该店的销售总和、月最高销售额、月最低销售额
 //        int[][] saleArr = { { 4 }, { 10, 12, 9 }, { 10, 19, 9 }, { 10, 12 } };
         // 下句语法正确,再次理解"二维数组就是元素为一维数组的一维数组"
         int[][] saleArr = {};
 //        System.out.println(saleArr);        // [[I@15db9742
 //        System.out.println(saleArr.length);        //
         System.out.println("2016年该店的销售总和为:" + yearTotal(saleArr) + "k元");
         System.out.println("2016年该店的月最高销售额为:" + monthMaxSale(saleArr) + "k元");
         System.out.println("2016年该店的月最低销售额为:" + monthMinSale(saleArr) + "k元");
     }
     /**
      * 计算年销售总和
      * @param arr:二维数组
      * @return:年销售总和
      */
     public static int yearTotal(int[][] arr) {
         int total = 0;
         for (int i = 0; i < arr.length; i++) {
             for (int j = 0; j < arr[i].length; j++) {
                 total += arr[i][j];
             }
         }
         return total;
     }
     /**
      * 统计月最高销售额
      * @param arr:二维数组
      * @return:月最高销售额
      */
     public static int monthMaxSale(int[][] arr) {
         int max = 0;
         for (int i = 0; i < arr.length; i++) {
             for (int j = 0; j < arr[i].length; j++) {
                 max = (max > arr[i][j]) ? max : arr[i][j];
             }
         }
         return max;
     }
     /**
      * 统计月最低销售额
      * @param arr:二维数组
      * @return:月最低销售额
      */
     public static int monthMinSale(int[][] arr) {
         // 如下写法逻辑错误,如果没有比0小的销售额,最小值就一直为0
 //        int min = 0;
         // 如下写法对于没有销售额的二维数组来说,执行时会产生异常
         // 产生异常:java.lang.ArrayIndexOutOfBoundsException: 0
         // 考虑设置二维数组的第一个二级元素为比较的标杆
 //        int min = arr[0][0];
         // 如果没有销售额时,如何处理?
         int min = (arr.length == 0) ? 0 : arr[0][0];
         for (int i = 0; i < arr.length; i++) {
             for (int j = 0; j < arr[i].length; j++) {
                 min = (min < arr[i][j]) ? min : arr[i][j];
             }
         }
         return min;
     }
 }
 package cn.temptation;
 import java.util.Scanner;
 public class Sample07 {
     public static void main(String[] args) {
         // 需求:编写程序,输出如下图形(杨辉三角)
         // 1
         // 1    1
         // 1    2    1
         // 1    3    3    1
         // 1    4    6    4    1
         // 1    5    10    10    5    1
         // 思路:(找规律)
         // 1、第n行有n个数(n从1开始)
         // 2、第1行和第2行均为1,从第3行开始,每行的首尾均为1
         // 3、从第3行的第2列开始到该行的倒数第二个数结束,该位置上的数等于上一行同列的数  + 上一行前一列的数
         //       从第4行的第2列开始到该行的倒数第二个数结束,该位置上的数等于上一行同列的数  + 上一行前一列的数
         //         ......以此类推
         System.out.println("键盘录入杨辉三角的行数:");
         Scanner input = new Scanner(System.in);
         int row = input.nextInt();
         input.close();
         // 考虑存储杨辉三角中的数进行计算,都是数字(具有相同意义),考虑使用数组;
         // 因为涉及到行列,考虑使用二维数组;
         // 因为行中的列数不同,所以声明及初始化数组时使用只有一级元素长度没有二级元素长度的定义方式
         int[][] arr = new int[row][];
         // 根据规律1
 //        arr[0] = new int[1];
 //        arr[1] = new int[2];
 //        arr[2] = new int[3];
 //        ...
 //        arr[n] = new int[n+1];
         for (int i = 0; i < row; i++) {
             // 二维数组中的每个一级元素依据规律1创建相应长度的一维数组
             arr[i] = new int[i + 1];
             // 依据规律2:第1行和第2行均为1,从第3行开始,每行的首尾均为1
             arr[i][0] = 1;
             arr[i][i] = 1;
         }
         // 依据规律3:从第3行的第2列开始到该行的倒数第二个数结束,该位置上的数等于上一行同列的数  + 上一行前一列的数
         //                从第4行的第2列开始到该行的倒数第二个数结束,该位置上的数等于上一行同列的数  + 上一行前一列的数
         //         ......以此类推
         for (int i = 2; i < arr.length; i++) {            // 外层循环的i表示行
             for (int j = 1; j < arr[i].length - 1; j++) {        // 内层循环的j表示列
                 arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1];
             }
         }
         // 调用方法打印数组
         printArray(arr);
     }
     /**
      * 打印数组
      * @param arr:二维数组
      */
     public static void printArray(int[][] arr) {
         // 遍历数组
         for (int i = 0; i < arr.length; i++) {
             for (int j = 0; j < arr[i].length; j++) {
                 System.out.print(arr[i][j] + "\t");
             }
             // 换行
             System.out.println();
         }
     }
 }
 package cn.temptation;
 import java.util.Scanner;
 public class Sample08 {
     public static void main(String[] args) {
         // 需求:制作一个成绩查询系统
         // 提供的数据有:
         // 1、给定学生的学号(1001, 1002, 1003)
         // 2、给定学生的三门功课的成绩(语文、数学、英语)
         // 要求:
         // 1、输入某个同学的学号,显示出该同学的三门功课的成绩
         // 2、输入某一门功课的编号(0---语文,1---数学,2---英语),显示该门功课成绩不及格的同学的学号,以及有多少个同学不及格
         // 关键点:学生的学号 和 其各门功课成绩如何对应起来?    考虑让学号数组的索引 和 成绩数组的一级元素的索引同步
         int[] studentArr = { 1001, 1002, 1003 };
         int[][] scoreArr = { { 10, 20, 30 }, { 40, 50, 60 }, { 70, 80, 90 } };
         // 课程数组的索引 和 成绩数组的二级元素的索引同步
         String[] courseArr = { "语文", "数学", "英语" };
         // 如下写法把学号和成绩糅合在一起存储也可以,但是不建议这样存储,因为我们说过数组是存储同一类型数据的容器
         // 这里说的同一类型不仅指的是同一种数据类型,也指的是有相同的语义类型的数据
 //        int[][] arr = { { 1001, 10, 20, 30 }, { 1002, 40, 50, 60 }, { 1003, 70, 80, 90 } };
         Scanner input = new Scanner(System.in);
         System.out.println("输入学生的学号:");
         int number = input.nextInt();
         // 调用方法
         getScoreByNumber(courseArr, studentArr, scoreArr, number);
         // 换行
         System.out.println();
         System.out.println("输入某一门功课的编号(0---语文,1---数学,2---英语)");
         int course = input.nextInt();
         // 调用方法
         getNGInfo(courseArr, studentArr, scoreArr, course);
         input.close();
     }
     /**
      * 根据学号获取该生的各门功课成绩
      * @param courseArr:    课程名称数组
      * @param studentArr:    学生学号数组
      * @param scoreArr:    学生成绩数组
      * @param number:        查询时录入的学生学号
      */
     public static void getScoreByNumber(String[] courseArr, int[] studentArr, int[][] scoreArr, int number) {
         for (int i = 0; i < studentArr.length; i++) {
             if (number == studentArr[i]) {        // 根据录入的学生学号在数组中找到对应的该学生的学号
                 // 因为学号数组的索引 和 成绩数组的一级元素的索引同步,所以在 成绩数组的一级元素对应的一维数组中查找该生的各门功课的成绩
                 for (int j = 0; j < scoreArr[i].length; j++) {
                     if (j == scoreArr[i].length - 1) {
                         System.out.print(courseArr[j] + ":" + scoreArr[i][j]);
                     } else {
                         System.out.print(courseArr[j] + ":" + scoreArr[i][j] + ",");
                     }
                 }
             }
         }
     }
     /**
      * 显示该门功课成绩不及格的同学的学号,以及有多少个同学不及格
      * @param courseArr:    课程名称数组
      * @param studentArr:    学生学号数组
      * @param scoreArr:    学生成绩数组
      * @param course:        录入的课程名称索引
      */
     public static void getNGInfo(String[] courseArr, int[] studentArr, int[][] scoreArr, int course) {
         int total = 0;
         System.out.println("【" + courseArr[course] + "】未及格学生的学号列表:");
         for (int i = 0; i < studentArr.length; i++) {
             if (scoreArr[i][course] < 60) {
                 total++;
                 System.out.print(studentArr[i] + "\t");
             }
         }
         // 换行
         System.out.println();
         System.out.println("【" + courseArr[course] + "】未及格学生的人数为:" + total);
     }
 }
【原】Java学习笔记012 - 数组的更多相关文章
- 【原】Java学习笔记011 - 数组
		
package cn.temptation; import java.util.Scanner; public class Sample01 { public static void main(Str ...
 - 【原】Java学习笔记010 - 数组
		
package cn.temptation; public class Sample01 { public static void main(String[] args) { // 需求:一堆分数,要 ...
 - Java学习笔记七——数组工具类Arrays
		
数组工具类Arrays Java提供的Arrays类里包含的一些static修饰的方法可以直接操作数组.若将里面的方法用熟的话,那开发效率会大大提高.下面介绍其中的方法. List<T> ...
 - java学习笔记六——数组
		
数组类型 数组是一种常见的数据结构,可用于存放多个数据,每一个数组元素存放一个数据,通常可以通过下标进行访问其元素. Java数组要求所有数组元素具有相同的数据类型.因此,数组元素的数据类型是唯一的. ...
 - Java学习笔记day04_数组
		
1.switch case switch语句中表达式的数据类型是有要求的: JDK 1.0 ~ 1.4 , 数据类型接受byte, short, int, char JDK 1.5 , 数据类型接受b ...
 - 1.14(java学习笔记)数组
		
假如我们需要用到1000个相同类型的数据,肯定不可能创建1000个变量, 这样既不方便,也不直观,也不便于我们使用.这时就需要用到数组. 一.数组的声明与使用 public class Array { ...
 - Java学习笔记 03 数组
		
一.数组的创建和使用 数组的创建和使用 >>创建方法1:先声明,再用new关键字分配内存(使用new关键字分配内存,整形数组中各个元素的初始值都为0) String str[]; str= ...
 - Java学习笔记之——数组
		
一.一维数组 1. 什么是数组 变量:在内存中开辟了一块空间 数组:在内存中开辟了一块连续的空间,每块空间保存的值/对象叫做元素,每个元素都有对应的下标.(下标从0开始) 2. 初始化一个数组 1)不 ...
 - java学习笔记之数组
 
随机推荐
- iFace安全专家揭秘:存放在区块链钱包中的比特币,其实已经早就不属于你……
			
自MoreToken钱包跑路之后,2019年3月以来陆续多个钱包.交易所跑路,造成了大量用户账户被盗,仅MoreToken钱包用户损失总价值就达12.2亿人民币,用户损失惨重.为什么这么多钱包.交易所 ...
 - 注解式controller开发,action找不到controller???
			
Spring这一列列的 , 配置是真的多,学完我都忘啦 那个配置是干什么的了. 这里我遇到的问题是 我前台 使用action请求controller中的方法时,却找不到 报错404. 首先你路径 ...
 - Python 字典和集合基于哈希表实现
			
哈希表作为基础数据结构我不多说,有兴趣的可以百度,或者等我出一篇博客来细谈哈希表.我这里就简单讲讲:哈希表不过就是一个定长数组,元素找位置,遇到哈希冲突则利用 hash 算法解决找另一个位置,如果数组 ...
 - OO(object oriented面向对象)
			
面向对象OO = 面向对象的分析OOA + 面向对象的设计OOD + 面向对象的编程OOP 一.OO - Object-Oriented(面向对象) 对象代表真实或抽象的事物,有一个名字(唯一标识), ...
 - Python爬虫入门教程 39-100 天津市科技计划项目成果库数据抓取 scrapy
			
爬前叨叨 缘由 今天本来没有打算抓取这个网站的,无意中看到某个微信群有人问了一嘴这个网站,想看一下有什么特别复杂的地方,一顿操作下来,发现这个网站除了卡慢,经常自己宕机以外,好像还真没有什么特殊的.. ...
 - SpringBoot完美配置阿里云的文件上传
			
新建一个config类 AliyunOSS.java @Configuration @Data public class AliyunOSS { private OSSClient ossClient ...
 - 精读《Serverless 给前端带来了什么》
			
1. 引言 Serverless 是一种 "无服务器架构",让用户无需关心程序运行环境.资源及数量,只要将精力 Focus 到业务逻辑上的技术. 现在公司已经实现 DevOps 化 ...
 - Oracle 查询结果集行数分析
			
本人曾去某金融软件公司面试,交流中面试官问的一个问题是:"如果有 A.B 两张表,A 表中有 2 条数据,B 表中有 200 条数据,请问 SELECT * FROM A,B 能查出多少条数 ...
 - Linux常用监控命令简介 - top
			
top -hv | -bcisS -d delay -n iterations -p pid [, pid ...] 指令介绍-b : 批次模式运行.-c : 显示执行任务的命令行.-d : 设定延迟 ...
 - js内存深入学习(一)
			
一. 内存空间储存 某些情况下,调用堆栈中函数调用的数量超出了调用堆栈的实际大小,浏览器会抛出一个错误终止运行.这个就涉及到内存问题了. 1. 数据结构类型 栈: 后进先出(LIFO)的数据结构 堆 ...