the same code can have different results depending on the object’s actual type at run-time.
not shown
the same code can have different results depending on the object’s actual type at run-time.
not shown
Programming Challenge : Shopping Cart
extraneous
Overloading Methods
跟 “继承” 没关系, unit5 有提到
@Override annotation
不考
design an online store with classes
class design is not tested
9.1.4. is-a vs. has-a (Day 2)
不重要
public class Car extends Vehicle
FRQ 要考
UML (Unified Modeling Language) class diagram
不用记
You can loop through just part of a 2D array. You can change the starting value and ending value to loop through a subset of a 2D array.
非常有用
getTotalForCol
col 不变,as a constant
8.2.4. Enhanced For-Each Loop for 2D Arrays (Day 2)
不用学
column-major order”
go down the column
for (int row = 0; row < array.length; row++) { for (int col = 0; col < array[0].length; col++) {
记住,考试的时候写出来就可以得分
Programming Challenge : ASCII Art
skip it
The length property
shorter instruction-------- rows; longer instruction --------------x=columns;
8.1.3. How Java Stores 2D Arrays
no need to read
8.1.3. How Java Stores 2D Arrays
no need to read
describes how selection sort works.
https://www.youtube.com/watch?v=EdUWyka7kpI&feature=youtu.be
这个更好
n this Binary Search Animation to see
https://yongdanielliang.github.io/animation/web/BinarySearchNew.html
this works
write a method called numMatches()
if you see "illegal start of expression", it's probably because of missing braces in main method.
want a nicer printout
list.size() Access value = array[index]; value = list.get(index); Modify array[index] = value; list.set(index,value);
k++;
won't remove 2nd in 2 consecutive
removes a name from a list.
最好用while,不用for
awt
Abstract Window Toolkit=AWT
static methods
without creating an object
java.lang package
java语言的核心
rounds up
=ROUND(3.238,2) 結果為 3.24,正常的四捨五入
=ROUNDUP(3.238,2) 結果為 3.24,不管下一位數是多少,都要進1
=ROUNDDOWN(3.238,2) 結果為 3.23
divide an integer by zero
denominator