所谓“实践是检验认识真理性的惟一标准”,我在IntelliJ IDEA上把教材第三章课后练习题又敲了一
遍,给出了本身的答案,并加上了一些本身的分析,经过逐题进行代码调试实践的方式来深刻对java类与对象的理解。小白在此恳请你们积极指出错误的地方(>_<)html
A
分析:java
import java.util.*; class Student9415 { String number; String name; int score; Student9415(String number, String name, int score) { this.number = number; this.name = name; this.score = score; } } public class Exercise9415 { public static void main(String[] args) { Set<Student9415> students = new HashSet<>(); students.add(new Student9415("B1234", "Justin", 90)); students.add(new Student9415("B5678", "Monica", 100)); students.add(new Student9415("B1234", "Justin", 100)); students.add(new Student9415("B5678", "Monica", 98)); students.add(new Student9415("B5678", "Monica", 100)); System.out.println(students.size()); } }
BC 分析:git
import java.util.*; public class Exercise9416 { public static void main(String[] args) { Set<Integer> numbers = new TreeSet<>(); numbers.add(1); numbers.add(2); numbers.add(1); numbers.add(3); foreach(numbers); } private static void foreach(Collection<Integer> numbers) { for(Integer number : numbers) { System.out.println(number); } } }
ABD
错选:AD
分析:
正则表达式
succeeded screenshot:算法
one example:
another example:
编程
(statistics.sh脚本的运行结果截图)数组
本周依然采用在蓝墨云班课上考试的形式,在25分钟的时间里须要做答26道选择题,并且还有很多多选题,甚至大多都是程序分析题,一道一道敲到电脑上再去运行确定是来不及的(>_<),更要命的是不少题不去跑程序的话我根本无从下手(>o<)因此仍是老老实实学扎实才是万全之策啊~网络
正确答案: A D
你的答案: A
分析:要成功复制目录须要加上 -r 或者 -R 参数,表示递归复制数据结构
正确答案: B C
你的答案: D
分析:反向引用 \1 表明第一个()中的匹配内容ide
正确答案: ABCD
个人答案: A C
分析:* 能够是0次
Suppose we have an array of String objects identified by the variable names. Which of the following for loops will not correctly process each element in the array.(假如咱们有一个名为names的String对象数组,下面哪一个for循环不能遍历数组中的每个元素?)
正确答案: C
个人答案: E
分析:Choice c will not process each element correctly due to a syntax error. The length variable is not a method and, therefore, does not have parenthesis after it. Choice b is an example of using a foreach loop to process an array, and choice a is a correct for loop.
Which of the statements is true about the following code snippet?(对于下面的代码段,说法正确的是?)
int[] array = new int[25]; array[25] = 2;
A .The integer value 2 will be assigned to the last index in the array.(整数2会赋给数组中最后一个元素)
B .The integer value 25 will be assigned to the second index in the array.(整数25会赋给数组中的第2个索引)
C .The integer value 25 will be assigned to the third value in the array. (整数25会赋给数组中的第3个元素)
D .This code will result in a compile-time error.(代码会产生编译时错误)
E .This code will result in a run-time error. (代码会产生运行时错误)
正确答案: E
个人答案: A
分析:This code will throw an ArrayIndexOutOfBoundsException, since the last index in this array will be 24. This causes a run-time error.
教材学习中的问题和解决过程, 一个问题加1分
代码调试中的问题和解决过程, 一个问题加1分
基于评分标准,我给本博客打分:XX分。得分状况以下:xxx
唉,今天是我心爱♥的macbook进水一周记念日QwQ,回想起一周前的那晚仍是心有余悸、难以释怀……在这没有mac的一周时光里,我居然苟延残喘地依赖着别人家的电脑奇迹般地活了过来而且奇迹般地貌似顺利完成了全部学习任务QwQ在此必需要点名感谢一波20155332盛照宗同窗的雪中送炭无偿提供他的lenovo来供我学习以及20145320周岐浩学长在周三java当堂考试时慷慨地借出他钟爱的笔记本电脑~不过话说回来用了一周照宗同窗的电脑让我着实体会了一波之前从未体验过的Windows10系统,还算比较顺手耶,这很大程度上消除了一直以来win10给我各方面都不太好的印象( •̀ ω •́ )y谁再说win10辣鸡我可要打他了啊ε=( o`ω′)ノ不过不管如何我也摆脱不了对mac的思念♥♥坐等五一回家保修ing......。┭┮﹏┭┮。
代码行数(新增/累积) | 博客量(新增/累积) | 学习时间(新增/累积) | 重要成长 | |
---|---|---|---|---|
目标 | 5000行 | 20篇 | 300小时 | |
第一周 | 34/34 | 1/4 | 12/12 | |
第二周 | 360/394 | 1/5 | 16/28 | |
第三周 | 701/1018 | 1/6 | 19/ 47 | 代码量激增( ̀⌄ ́) |
第四周 | 608/1375 | 1/7 | 18/55 | ①蹭了一节张健毅老师的Java课;②本身将数据结构课上所学的排序算法除了基数排序以外所有用C语言实现了一遍(`_´)ゞ;③本次博客前所未有的长:) |
第五周 | 1205/2580 | 1/8 | 9/64 | 蹭了一节张健毅老师的Java课 |
第六周 | 826/3339 | 1/9 | 8/72 | |
第七周 | 3119/6476 | 2/11 | 13/85 | ①蹭了一节张健毅老师的Java课;②在写了无数篇实验报告以后还写了两篇博客!! |
第八周 | / | 1/12 | 10/95 | |
第九周 | / | 2/14 | 12/107 | 本周又写了两篇博客! |
第十周 | / | 1/15 | 8/115 |
计划学习时间:10小时
实际学习时间:8小时