摘要: 运行结果: 阅读全文
posted @ 2017-08-20 10:23 hou-xudong 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 输出: 阅读全文
posted @ 2017-08-02 20:14 hou-xudong 阅读(1074) 评论(0) 推荐(0) 编辑
摘要: 选择排序 冒泡排序: 阅读全文
posted @ 2017-07-31 20:53 hou-xudong 阅读(216) 评论(0) 推荐(0) 编辑
摘要: public class A {public String show(D obj) {return ("A and D");}public String show(A obj) {return ("A and A");} }class B extends A{public String show(B 阅读全文
posted @ 2017-07-26 13:45 hou-xudong 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 一、冒泡排序 1、原理:从数组的第一个位置开始两两比较array[index]和array[index+1],如果array[index]大于array[index+1]则交换array[index]和array[index+1]的位置,止到数组结束; 从数组的第一个位置开始,重复上面的动作,止到数 阅读全文
posted @ 2017-07-26 13:37 hou-xudong 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 1. 什么是泛型?泛型(Generic type 或者 generics)是对 Java 语言的类型系统的一种扩展,以支持创建可以按类型进行参数化的类。可以把类型参数看作是使用参数化类型时指定的类型的一个占位符,就像方法的形式参数是运行时传递的值的占位符一样。可以在集合框架(Collection f 阅读全文
posted @ 2017-06-27 23:07 hou-xudong 阅读(555) 评论(0) 推荐(0) 编辑
摘要: 在Eclipse中查看JDK类库的源代码!!! 设置: 1.点 “window”-> "Preferences" -> "Java" -> "Installed JRES" 2.此时"Installed JRES"右边是列表窗格,列出了系统中的 JRE 环境,选择你的JRE,然后点边上的 "Edit 阅读全文
posted @ 2017-06-20 23:02 hou-xudong 阅读(188) 评论(0) 推荐(0) 编辑
摘要: package cn.hxd.collection; /** * 创建一个节点类 * @author Administrator * */ public class Node { Node previous; Object object; Node next; public Node() { } public Node(Node privious, Object obje... 阅读全文
posted @ 2017-06-16 16:17 hou-xudong 阅读(186) 评论(0) 推荐(0) 编辑
摘要: package cn.hxd.collection; import java.util.ArrayList;import java.util.List; /** * 自己实现一个ArrayList * @author HXD * */public class ArrayList01 { privat 阅读全文
posted @ 2017-06-15 23:24 hou-xudong 阅读(458) 评论(0) 推荐(0) 编辑
摘要: 1.ArrayList是实现了基于动态数组的数据结构,LinkedList基于链表的数据结构。 2.对于随机访问get和set,ArrayList优于LinkedList,因为ArrayList可以随机定位,而LinkedList要移动指针一步一步的移动到节点处。(参考数组与链表来思考) 3.对于新 阅读全文
posted @ 2017-06-15 16:07 hou-xudong 阅读(206) 评论(0) 推荐(0) 编辑