![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
cs 300
UM-Madison cs 300 笔记
MOFD0
这个作者很懒,什么都没留下…
展开
-
4 Inheritance and Interface
1 Derived classesDerived class concept对于已经存在的class,如果要 define 一个 indepedent class 是需要重新写所有完整代码的;但是如果从这个 class derive 出一个 derived class(subclass) 只需要完成 derived class 和 base class (superclass)中不同的部分即可...原创 2020-02-09 07:24:55 · 210 阅读 · 0 评论 -
3 Exception Handling
Error-checking code is code a programmer writes to detect and handle errors that occur during program execution. An exception is a circumstance that a program was not designed to handle, such as if th...原创 2020-02-06 06:53:46 · 170 阅读 · 0 评论 -
EnumerationType
Enumeration是一种跟字符串很像的数据类型Declaration (使用类的方式声明)// 其中所有的值必须是 defined names 不能是 numerical valuespublic enum favouriteGames{CSGO,LOL,TAITAN_FALLS,COD};How to use?decalare 的位置在main method之外只要涉...原创 2020-02-02 03:45:35 · 290 阅读 · 0 评论 -
Coding Note
Java import 位于top-level class之外Java中true和false和C++种不一样不是具体的数值,是表示含义的字符串,不能用于比较大小,互相之间也不能比较大小Method 的 Javadoc 中a) @return不但要说出return的含义也要说出return的类型b) 第一行的描述以Return开头,无return的就描述干了什么TestMethod一般都...原创 2020-01-30 12:04:15 · 94 阅读 · 0 评论 -
2 Creating Class
1 Using a classThe operator “.” is called the member access operatorString is a kind of object and has its own methods, feo example// Return character value at the indexpublic char charAt(int in...原创 2020-01-30 11:58:13 · 164 阅读 · 0 评论 -
1 Procedural Programming and Using Objects
1. Basic debugging:visual inspection:假设statement是错误的并检验是否确实是错误的;最好每写几条statement之后就test看看是否有bugInserting debug output statements:插入检测语句测试部分代码是否正常运转Hierarchical debugging:代码过长,每一部分都插入测试语句过于繁琐;将代码分...原创 2020-01-23 14:25:53 · 382 阅读 · 0 评论