background picture of the home page

Welcome to SMZZ!

线程创建常用的四种方式

java中创建线程的四种方法以及区别 Java使用Thread类代表线程,所有的线程对象都必须是Thread类或其子类的实例。Java可以用四种方式来创建线程,如下所示: 1)继承Thread类创建线程 2)实现Runnable接口创建线程

thumbnail of the cover of the post

Map的几种遍历方式

Map集合循环遍历方式一: 通过Map.keySet()遍历key和value Map集合循环遍历方式二: 通过迭代器的方式 Map集合循环遍历方式三:通过Map.entrySet遍历key和value 推荐,尤其是容量大时 Map集合循环遍历方式四:通过Map.values()遍历所有的value

thumbnail of the cover of the post