- 博客(4)
- 资源 (2)
- 收藏
- 关注
原创 继承与泛型
/* 其中:Person是Student和Worker的父类 java的泛型中,List中泛型定义为父类的,为什么可以添加继承类(子类的)? */ public class Test { public static void main(String[] args) { List list = new ArrayList(); list.add(new Student());//为什么此行代码没...
2019-11-05 20:02:16 220 1
原创 手写二叉树
private Node root; private class Node{ E data; Node parent; Node left; Node right; public Node(E e) { data = e; } //对节点进行比较,并存方法 public boolean addChild(E e) { int val = e.compareTo(data);...
2019-07-17 10:40:14 109
原创 javap 手册
栈和局部变量操作 将常量压入栈的指令 aconst_null 将null对象引用压入栈 iconst_m1 将int类型常量-1压入栈 iconst_0 将int类型常量0压入栈 iconst_1 将int类型常量1压入栈 iconst_2 将int类型常量2压入栈 iconst_3 将int类型常量3压入栈 iconst_4 将int类型常量4压入栈 iconst_5 将int类型常量5压入栈 ...
2019-07-17 10:36:33 157
原创 手写双向循环链表
双向循环链表 LinkedList 内部结构就是一个 双向循环链表 经典面试题目: 编写双向循环链表,实现:追加、插入、删除、遍历 public class LinkedList<E>{ private Node head; private int size; private class Node{ E data; Node prev; Node next; pu...
2019-02-22 08:31:59 163
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人