Skip to content

Instantly share code, notes, and snippets.

View jingjiecb's full-sized avatar

Zilong Liu jingjiecb

View GitHub Profile
@jingjiecb
jingjiecb / gist:902b8dd310234584aaef700e835394e6
Created April 7, 2023 14:44
自己继承AQS实现自定义锁,交替输入输出0和1
package org.example;
import java.util.concurrent.locks.AbstractQueuedSynchronizer;
import java.util.concurrent.locks.ReentrantLock;
/**
* @author claws
* @since 2023/4/7
*/
public class Main {
@jingjiecb
jingjiecb / PaintingDsl.groovy
Last active May 5, 2023 17:05
PaintingDsl的测试脚本和定义脚本
package top.claws.dsl
import javax.swing.JFrame
import javax.swing.JPanel
import java.awt.Color
import java.awt.Graphics
/**
* @author claws
* @since 2023/5/5
@jingjiecb
jingjiecb / FunctionalInterface.java
Created May 7, 2023 09:13
函数式接口示例
package org.example;
/**
* @author claws
* @since 2023/5/7
*/
public class InterfaceTester {
public static void main(String[] args) {
Printer printer = new Printer();
Person claws = new Person("claws");