![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JAVA学习笔记
G-String
这个作者很懒,什么都没留下…
展开
-
java创建静态map并设置初始值
1.使用匿名内部类public static HashMap<String, Integer> map = new HashMap<String,Integer>(){{put(“a”,1);put(“b”,2);put(“c”,3);put(“d”,4);}};即使加了final修饰符,用此方法创建的map也可以被修改2.使用静态代码块:public static Map<String, Integer> map;static {Map<原创 2021-09-03 11:52:57 · 3513 阅读 · 0 评论 -
Spring接口返回图片字节流
@RequestMapping("/queryPic")@ResponseBodypublic void queryPic(HttpServletResponse response) { File file = new File("D:\\test.png"); try { FileInputStream inputStream = new FileInputStream(file); byte[] data = new byte[(int) file.l原创 2021-09-03 11:16:17 · 446 阅读 · 0 评论 -
JAVA实现选择排序与冒泡排序
public class Demo_Sort { public static void main(String[] args) { //执行冒泡排序 bubbleSort(new int[]{123, 2, 1, 123, 132, 89, 380, 18, 2154, 42}); System.out.println(); //...原创 2019-08-12 21:29:09 · 101 阅读 · 0 评论