摘要:
坑1,用Array.asList转换基础类型数组 代码 @Slf4j public class ArrayAsListDemo { public static void intArrayToList() { int[] arr = {1, 2, 3}; List list = Arrays.asLi 阅读全文
摘要:
实体类 class Point { private int x; private int y; public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; 阅读全文
摘要:
代码 @Slf4j public class StringCompareDemo { public static void compare() { String a = "1"; String b = "1"; log.info("\nString a = \"1\";\n" + "String b 阅读全文
摘要:
实例级别的锁 实例代码 @Slf4j public class AddCompareDemo { private int a, b; public void add() { for (int i = 0; i < 10000; i++) { a++; b++; } } public void com 阅读全文
摘要:
ThreadLocal ThreadLocal 适用于变量在线程间隔离,而在方法或类间共享的场景。 代码 1 @RestController 2 public class ThreadLocalController { 3 private static final ThreadLocal<Strin 阅读全文
摘要:
newFixedThreadPool @Slf4j public class TheadPoolDemo { private static ThreadPoolExecutor threadPool = (ThreadPoolExecutor) Executors.newFixedThreadPoo 阅读全文
摘要:
代码 1 @Slf4j 2 public class IntegerCompare { 3 public static void doCompare() { 4 5 Integer a = 127; //Integer.valueOf(127) 6 Integer b = 127; //Intege 阅读全文
摘要:
C语言代码 #include <stdio.h> int main() { printf("hello, world\n"); return 0; } GCC编译 gcc -o hello hello.c 会得到一个hello的可执行二进制文件 执行 ./hello 打印出hello, world 阅读全文