摘要:
5.7 Java 中的构造方法调用顺序 如果子类没写 super,默认先执行父类的无参构造方法 类型转换 boolean result = 子 instanceof 父,返回true,用于判断是否继承 Person tom = new Student(); //向上转型,先声明一个父类,再实例化子类 阅读全文
摘要:
类和对象4.18 package demo_student; public class demo { public static void main( String[] args){ //根据student类,创建一个stu对象 //因为在同一个类中,所以不用import student stu = 阅读全文
摘要:
4.2 Lc.5.最长回文串 class Solution { public String longestPalindrome(String s) { int len = s.length(); if (len < 2) { return s; } int maxLen = 1; int begin 阅读全文
摘要:
4.1 Lc.221.最大正方形 暴力法 有点难懂 class Solution { public int maximalSquare(char[][] matrix) { int maxSide = 0; int rows = matrix.length, cols = matrix[0].len 阅读全文