11 2022 档案

摘要:先上测试代码: public class Test{ public static void main(String[] args) { Integer l1 = new Integer(1); Integer l2 = new Integer(1); System.out.println(l1==l 阅读全文
posted @ 2022-11-24 08:46 Shapley 阅读(289) 评论(0) 推荐(0) 编辑
摘要:1.按Java理论,父类与子类的初始化顺序为: 1.初始化父类静态变量 2.初始化父类的静态代码块 3.初始化子类的静态变量 4.初始化子类的静态代码块 5.父类的非静态变量 6.父类的非静态代码块 7.父类的构造函数 8.子类的非静态变量 9.子类的非静态代码块 10.子类的构造函数 验证代码: 阅读全文
posted @ 2022-11-20 13:27 Shapley 阅读(391) 评论(0) 推荐(0) 编辑
摘要:首先,示例来自Bruce Eckel的《On Java》: // housekeeping/ExplicitStatic.java // (c)2021 MindView LLC: see Copyright.txt // We make no guarantees that this code i 阅读全文
posted @ 2022-11-08 08:48 Shapley 阅读(64) 评论(0) 推荐(0) 编辑
摘要:先用javac编译,带参数-d javac -d . ****.java 然后,在当前目录下(不要到****子目录),运行java即可。 java ***.***** 如: java com.FuctionDemo2 package com; import java.util.function.Fu 阅读全文
posted @ 2022-11-03 09:21 Shapley 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-11-01 15:35 Shapley 阅读(32) 评论(0) 推荐(0) 编辑