java
月屯
学会做夜空中那颗最亮的星
展开
-
java注解自定义与使用
参考1参考2原创 2023-06-17 16:09:44 · 178 阅读 · 0 评论 -
平衡二叉树、红黑树、b树、b+树
二叉平衡树的节点package main.AVL;public class AVLNode { private int value; private int bf; private AVLNode left; private AVLNode right; private AVLNode parent; public int getValue() { return value; } public void set原创 2021-09-23 16:31:17 · 204 阅读 · 0 评论 -
SpringAOP
在ideal中创建maven项目一直点next知道finish完成项目创建aop 简单使用添加依赖在SpringAOP\pom.xml添加以下依赖 <dependencies> <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-aop --> <dependency> <grou原创 2021-08-03 20:25:34 · 75 阅读 · 0 评论 -
jackson的使用
在maven项目中,首先在pom.xml引入jackson public static void main(String[] args) throws JsonProcessingException { Map<String, Object> map = new HashMap<>(); map.put("state", 200); map.put("msg", "操作成功"); List<UserInf原创 2021-05-23 14:14:51 · 92 阅读 · 0 评论 -
ideal servlet中使用jquery
Servlet中使用外部JS 的步骤:1、将js复制到webapp目录下。2、设置servlet的属性原创 2021-05-23 10:16:09 · 177 阅读 · 0 评论 -
集合中的lambda
public static void main(String[] args) { HashMap<Integer, String> map = new HashMap<>(); map.put(1, "hello"); map.put(2, "bit"); map.put(3, "hello"); map.put(4, "lambda"); map.forEach(new BiCon..原创 2021-03-03 11:54:47 · 127 阅读 · 0 评论 -
枚举类型
public enum TestEnum { RED("red",1),GREEN("green",2),BLACK("black",3); public String color; public int ordinal; //默认是私有的构造方法 TestEnum(String color,int ordinal) { this.color = color; this.ordinal = ordinal; } pu原创 2021-03-03 10:51:13 · 69 阅读 · 0 评论 -
冲突-解决-开散列/哈希桶模拟Map集合bing
class MyHashMap { //节点static class Node{ private int key; private int value; private Node next; public Node() { } public Node getNext() { return next; } public void setNext(Node next) {原创 2021-02-06 11:53:17 · 119 阅读 · 0 评论 -
自定义类实现PriorityQueue(bing大根堆,小根堆)
public class HeapDemo { public int[] elem; public int usedSize; public HeapDemo() { this.elem = new int[10]; } /** * 在这里 为什么可以传len * 是因为每棵树的结束位置 实际上都是一样的 * @param parent * @param len 假设长度为10 len 就是10原创 2021-01-29 23:08:33 · 322 阅读 · 0 评论 -
ideal链接mysql jdbc
导入依赖的jar包代码import java.sql.*;/*ctrl + alt + V 快速生成局部变量ctrl + alt + F 快速生成成员变量ctrl + alt + T 快速生成(try..catch)代码块ctrl + alt + M 快速封装方法*/public class Main { public static void main(String[] args) { Connection connection = null;原创 2021-01-26 19:20:07 · 196 阅读 · 0 评论 -
自定义单链表以及常用的方法
class Node { int a; Node next; public Node(int x) { a = x; }}class NodeList { Node head; public Node head() { return head; } public Node last() { Node c = head; if (c == null)原创 2020-12-31 14:42:55 · 168 阅读 · 0 评论