随笔分类 -  Java

摘要:package com.gibe; import javax.swing.*; import java.awt.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; public class Listen exte 阅读全文
posted @ 2021-07-31 23:02 ascertain 阅读(65) 评论(0) 推荐(0) 编辑
摘要:package ersatz; import java.util.Comparator; import java.util.LinkedList; import java.util.List; public class Ersatz { public static void main(String[ 阅读全文
posted @ 2021-07-16 17:25 ascertain 阅读(301) 评论(0) 推荐(0) 编辑
摘要:package ersatz; import java.io.FileNotFoundException; public class Ersatz { public static void main(String[] args) throws FileNotFoundException { try 阅读全文
posted @ 2021-07-15 11:36 ascertain 阅读(38) 评论(0) 推荐(0) 编辑
摘要:有关详细信息,请参见https://docs.spring.io/spring-boot/docs/current/reference/html/executable-jar.html。 Manifest-Version: 1.0 Created-By: Maven Archiver 3.4.0 M 阅读全文
posted @ 2021-07-14 15:17 ascertain 阅读(91) 评论(0) 推荐(0) 编辑
摘要:package ersatz; import java.io.FileNotFoundException; public class Ersatz { public static void main(String[] args) throws FileNotFoundException { long 阅读全文
posted @ 2021-07-13 11:42 ascertain 阅读(54) 评论(0) 推荐(0) 编辑
摘要:package io; public class T { public static void main(String[] args) { String b = "124356789123456"; String bb = "124356789123456.124356789123456"; Sys 阅读全文
posted @ 2021-07-12 14:19 ascertain 阅读(742) 评论(0) 推荐(0) 编辑
摘要:Boolean Character Number 手动装箱 第一种 构造器 手动装箱方法 Deprecated , 会产生不同的 Integer对象 , 提倡 使用 static factory Integer.valueOf() 手动拆箱 自动装箱 底层调用Integer.valueOf() 自动 阅读全文
posted @ 2021-07-10 22:34 ascertain 阅读(38) 评论(0) 推荐(0) 编辑
摘要:package ersatz; public class Car { private double temperature; public Car(double temperature) { this.temperature = temperature; } private class Air { 阅读全文
posted @ 2021-07-09 16:25 ascertain 阅读(45) 评论(0) 推荐(0) 编辑
摘要:枚举: 自定义枚举类 使用enum关键字 不需要提供setXxx方法, 枚举对象通常只读 对枚举对象使用static final, 实现底层优化 枚举对象可有多个属性 package com.gibe; public class Enumeration { public static void ma 阅读全文
posted @ 2021-07-08 18:12 ascertain 阅读(301) 评论(0) 推荐(0) 编辑
摘要:package com.gibe; public class Ersatz { public static void main(String[] args) { // 外部其他类, 使用成员内部类三种方法 Outer outer = new Outer(); outer.mm(); // 外部ins 阅读全文
posted @ 2021-07-08 14:26 ascertain 阅读(40) 评论(0) 推荐(0) 编辑
摘要:idea 错误提示 @Override 重写方法的目的是为了多态, 重写是实现多态的前提, 即重写是发生于继承且针对非static方法 语法上子类允许出现和父类只有方法体不一样的static方法, 但语法上static支持重写, 但是运行上达不到多态 a的编译类型为 父类A, 运行类型为 子类B, 阅读全文
posted @ 2021-07-07 10:52 ascertain 阅读(69) 评论(0) 推荐(0) 编辑
摘要:The Java Language Specification recommends listing modifiers in the following order: 1. Annotations 2. public 3. protected 4. private 5. abstract 6. s 阅读全文
posted @ 2021-07-07 10:24 ascertain 阅读(69) 评论(0) 推荐(0) 编辑
摘要:UsbInterface.java package com; public interface UsbInterface { abstract public void start(); abstract public void stop(); } Camera.java package com; p 阅读全文
posted @ 2021-07-06 16:42 ascertain 阅读(62) 评论(0) 推荐(0) 编辑
摘要:饿汉式: 构造器私有化 => 防止直接new 类内部创建对象赋予static变量 向外暴露static公共方法,返回类实例变量 package com; public class Singleton { private String name; public static int n = 22; p 阅读全文
posted @ 2021-07-06 14:06 ascertain 阅读(234) 评论(0) 推荐(0) 编辑
摘要:split package com.equal_; import java.sql.SQLException; public class Cast { public static void main(String[] args) throws SQLException{ String s="ABCD 阅读全文
posted @ 2021-07-01 17:36 ascertain 阅读(56) 评论(0) 推荐(0) 编辑
摘要:public class Queen { protected int num = 8; // the number of queens // chessboard索引表示行,即第几个queen,chessboard[i]=value,表示第i+1个queen,位于value+1列 int[] che 阅读全文
posted @ 2021-06-22 11:20 ascertain 阅读(18) 评论(0) 推荐(0) 编辑
摘要:Labyrinth public class Labyrinth { public static void main(String[] args){ Map map=new Map(); map.init(); map.show(); Mouse mouse=new Mouse(); mouse.s 阅读全文
posted @ 2021-06-20 16:46 ascertain 阅读(121) 评论(0) 推荐(0) 编辑
摘要:杨辉三角 import java.util.Scanner; public class B { public static void main(String[] args) { int[][] array=new int[10][]; for(int i=0;i<array.length;++i){ 阅读全文
posted @ 2021-06-20 10:59 ascertain 阅读(45) 评论(0) 推荐(0) 编辑
摘要:import java.util.Scanner; public class B { public static void main(String[] args) { String[] names={"aa","bb","cc","dd"}; System.out.println("name: ") 阅读全文
posted @ 2021-06-19 15:21 ascertain 阅读(39) 评论(0) 推荐(0) 编辑
摘要:import java.util.Scanner; public class B{ public static void main(String[] args){ Scanner scanner1 = new Scanner(System.in); byte level=scanner1.nextB 阅读全文
posted @ 2021-05-17 06:33 ascertain 阅读(73) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示