10 2018 档案
摘要:【定义】 error: external, like out of memory exception: internal, like file not found 父类都是throwable 逻辑有错是runtimeerror 【是否check】 unchecked types: error, ru
阅读全文
摘要:MODEL //yuec2 Yue Cheng package hw2; import java.io.File; import java.io.FileNotFoundException; import java.util.HashMap; import java.util.Scanner; im
阅读全文
摘要:【定义】 有index的集合 【hash的原理】 term for a situation when two different objects return the same hashcode: hash collision 就是无规律的一一对应排序,相同object对应的HASH应该相同,相同对
阅读全文
摘要:【真假分数相加】 //inheritence, extends, use this & super 子类的方法 //two constructors, non-default use 'this' 子类的变量 【Java课程学习】 content //use string array to fill
阅读全文
摘要:【方法】 字写大点,先注释框架 链表:指针走就行了,最多是两个同时一起走。 两个链表求交点 //corner case if (headA == null || headB == null) { return null; } //keep the same length int A_len = ge
阅读全文
摘要:【定义】 表示object的集合 generic class:可以用于多种object, 抽象类的具体实现: 【ArrayList】 动态添加,只能加Non-primitive type,要初始化长度。 【compare】记忆方法:BT1 用this,T02 用object comparable:比
阅读全文
摘要:通过关键字extends来创建一个类的子类。一个类通过关键字implements声明自己使用一个或者多个接口。 settext是根据数组新建的pets[1]object来的,对其调用抽象方法talk,数量上要输出dog object中的dogcount
阅读全文
摘要:[抄题]: You are given an array A of strings. Two strings S and T are special-equivalent if after any number of moves, S == T. A move consists of choosin
阅读全文
摘要:[抄题]: An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i <= j, A[i] <= A
阅读全文
摘要:[抄题]: Given a binary tree rooted at root, the depth of each node is the shortest distance to the root. A node is deepest if it has the largest depth p
阅读全文
摘要:[抄题]: Given a robot cleaner in a room modeled as a grid. Each cell in the grid can be empty or blocked. The robot cleaner with 4 given APIs can move f
阅读全文
摘要:【AWT-SWING-JAVA FX】 多平台、多应用的现有通用类 【inner class】 (member class)inside another class, outside any method. can call outer class's data or method. 使用单方法的接
阅读全文
摘要:super.bark(); 不要第一个括号 Write a concrete meow( ) method 抽象类实例化后要加一个实例化的方法。 抽象类里可以没有抽象方法。 What does it mean to say that inheritance hierarchies are coupl
阅读全文
摘要:【知识】 主类中用constructor建对象,子类中用关键字。 【过程分析】 开始觉得自己能行,一次告一点地写到了7:00,后来一run发现写完的全是错,而且还有半个函数没写,UX小姐姐帮我写完的。不然那要跪,真的很危险。 【原因】 理解题意都要好长的时间,但是还是要基本理解的。一些知识点第一次学
阅读全文
摘要:hardcode版本 估计只能过一个吧 import java.util.*; public class NextServer { Map<Integer, Integer> serverCount = new HashMap<Integer, Integer>(); //serverNum use
阅读全文
摘要:【概念】 方法名相同,具体操作根据类不同。 eg 有open()方法的ebook, kindle 都会被打开 eg 动物叫声不同 inheritance:只有superclass subclass都有的方法才能调用 supperclass big = subclass small dynamic b
阅读全文