随笔分类 - java修炼之路
一个人最牛B的不是他建起了一座高楼,而是他敢于摧毁自己所建的高楼,然后重造
摘要:1.1模块化概述 Java语言随着这些年的发展已经成为了一门影响深远的编程语言,无数平台,系统都采用Java语言编写。但是,伴随着发展,Java也越来越庞大,逐渐发展成为一门“臃肿”的语言。而且,无论是运行一个大型的软件系统,还是运行一个小的程序,即使程序只需要使用Java的部分核心功能,JVM也要
阅读全文
摘要:1.类加载器 1.1类加载 1.2类加载器 public static void main(String[] args) { // static ClassLoader getSystemClassLoader() 返回用于委派的系统类加载器。 // ClassLoader getParent()
阅读全文
摘要:1.体验Stream public static void main(String[] args) { // 1.传统实现方式 ArrayList<String> list = new ArrayList<>(); list.add("张无忌"); list.add("张三丰"); list.add
阅读全文
摘要:1.概述 @FunctionalInterface public interface FunctionInterface { void show(); } 2.函数式接口作为方法参数 public class Demo { public static void main(String[] args)
阅读全文
摘要:1.体验一下方法引用 public interface PrintInterface { void print(String s); } public class Demo { public static void main(String[] args) { show(s -> System.out
阅读全文
摘要:1.概述 2.接口中的默认方法 默认方法的出现解决了java在一些老接口更新时,之前的实现类不必一定都要追加重写新增的方法,例如JKD11.0版本里面List接口新增了很多方法,但是,之前的ArrayList等子类就不必跟着强制更新重写List接口的新方法,在需要使用时可以手动追加重写;这在我们今后
阅读全文
摘要:1.概述 2.体验lambda public static void main(String[] args) { //匿名内部类启动线程 new Thread(new Runnable() { @Override public void run() { System.out.println("匿名内
阅读全文
摘要:1.网络编程入门 1.1.网络编程概述 1.2网络编程三要素 1.3 IP IP地址常用命令: ipconfig 查看本机IP地址 ping IP地址 检查网络是否连通 特殊IP地址:127.0.0.1:是回送地址,可以表示本机地址,一般用来测试使用 1.4 InetAddress // InetA
阅读全文
摘要:1.进程 2.线程 例如记事本:我们在打开记事本的时候打开页面设置: 上面这种情况说明记事本整个执行流程只有一条执行路径,是单线程程序 再例如QQ: 上面QQ的聊天界面和好友搜索界面有各自的执行路径,说明QQ是多线程程序 3.多线程实现方式 方式1: public class MyThread ex
阅读全文
摘要:概述 1.Properties作为Map使用 // 创建对象不可使用泛型 Properties properties = new Properties(); // 存储元素 properties.put("张飞","18"); properties.put("关羽","19"); propertie
阅读全文
摘要:1.概述 public class Student implements Serializable {} public class Xuliehua { public static void main(String[] args) throws IOException { ObjectOutputS
阅读全文
摘要:1.标准输入流 public final class System public static final InputStream in“标准”输入流。 该流已经打开,准备提供输入数据。 通常,该流对应于键盘输入或由主机环境或用户指定的另一个输入源。 public static final Prin
阅读全文
摘要:1.概述 2.分类 3.字节流 /** * 创建字节输出流对象,下面的的语句一共做了3件事情: * A:调用系统功能,创建了文件 * B:创建了字节输出流对象 * C:让字节输出流对象指向创建好的文件 */ FileOutputStream outputStream = new FileOutput
阅读全文
摘要:1.概述 //构造方法1: File file1 = new File("E://abc/a.txt"); //构造方法2: File file2 = new File("E://abc","a.txt"); //构造方法3: File file = new File("E://abc"); Fil
阅读全文
摘要:1.概述 案例1: public static void main(String[] args) { //不死神兔,求第20个月兔子的对数 //每个月兔子对数:1,1,2,3,5,8,13..... System.out.println(new Digui().f(20));//6765 } pub
阅读全文
摘要:ArrayList<String> strings = new ArrayList<String>(); strings.add("aa"); strings.add("dd"); strings.add("cc"); strings.add("ee"); System.out.println(st
阅读全文
摘要:本篇讲述的是map的基本使用,关于map的高级知识学习可以参考: https://www.cnblogs.com/luzhanshi/p/13399046.html 1.概述 2.Map的获取功能 3.遍历 方式1: HashMap<String, String> hashMap = new Has
阅读全文
摘要:1.概述 2.泛型类 public class FanXingClass<T> { private T t;//当我们不确定某个类的成员的类型的时候我们利用使用泛型类 public void show(T t){//当我们不确定某个类的成员方法的参数类型的时候我们利用使用泛型类 System.out
阅读全文
摘要:1.Set概述 HashSet 添加元素如果重复会默认覆盖之前的元素: HashSet hashSet = new HashSet(); hashSet.add("qqq"); hashSet.add("www"); hashSet.add("eee"); hashSet.add("www"); S
阅读全文
摘要:Student student = new Student("學生1", 11); System.out.println(student.hashCode());//356573597 String s1="信息"; String s2="科技"; String s3="重地"; String s4
阅读全文

浙公网安备 33010602011771号