教材学习内容总结

1. 时间与日期

1.1 时间的度量

  • GMT -> UT -> TAI -> UTC
英文 缩写
Greenwich Mean Time GMT
Universal Time UT
International Atomic Time TAI
Coordinated Universal Time UTC
  • Unix时间以1970年1月1日00:00:00为起算点

1.2 年历标准

  • ISO 8601标准

时间日期表示方法标准,用以统一时间日期的数据交换格式

1.3 时区

  • UTC偏移、日光节约时间(夏季时间)

2. Date与Calendar

1.1.1 Date

  • 用途:用来当作时间轴上的某一瞬间
  • 构建方法:Date()、Date(long date)
  • 方法:getTime()、setTime()

1.1.2 DateFormat

java.text.DateFormat(抽象类)

其操作类为java.text.SimpleDateFormat parse()

其含静态方法:getDateInstance()、getTimeInstance()、getDateTimeInstance()

3. JDK8新时间日期API

教材学习中的问题和解决过程

  • 1.抽象类可以创建对象吗?
  • 可以在创建标签的时候使用,例如教材P432的第一个程序中就用到了抽象类DateFormat(DateFormat dateFormat = new SimpleDateFormat(args.length == 0 ? "EE-MM-dd-yyyy" : args[0]); )
  • 2.java.text.DateFormat与java.text.NumberFormat究竟有什么不同呢?
  • 两者使用上类似,前者是对日期时间的格式化,后者是对数字进行格式化。
  • 3.Date、DateFormat、Calendar三者各自有什么区别?用法是什么?
  • Date:时间轴上的瞬时
  • DateFormat:格式化时间日期
  • Calendar: 对时间日期进行相关操作

代码调试中的问题和解决过程

  • 1.创建Date实例时使用构建date()和date(long date)时得出的结果是一样的,这是为什么呢?
  • 查了一下API文件,上面对于这两个的构建方法的解释是
  • 都是“Allocates a Data Object”,所不同的是后者是从long date标准基准时间(1970 年 1 月 1 日 00:00:00 GMT)来指定。前者没有参数传入,而后者有参数传入。

代码托管

(因为中途换电脑的原因,部分代码无法识别)

上周考试错题总结

  • 1.下面哪条命令可以把 f1.txt 复制为 f2.txt ?
  • A. cp f1.txt f2.txt
  • B. copy f1.txt f2.txt
  • C. cat f1.txt > f2.tx
  • D. cp f1.txt | f2.tx
  • E. copy f1.txt | f2.tx
  • 正确答案: A C 你的答案: A B
  • [解析]copy是Windows下的命令。cat f1.txt > f2.tx 通过输出重定向实现了复制。
  • 2.Which of the following are built-in streams in Java? (Choose all that apply.)
  • A. System.err
  • B. System.error
  • C. System.in
  • D. System.input
  • E. System.out
  • F. System.output
  • 正确答案: A C E 你的答案: B C E
  • [解析]The System class has three streams: in is for input, err is for error, and out is for output. Therefore A, C, and E are correct. The others do not exist.
  • 4.Assuming zoo-data.txt is a multiline text file, what is true of the following method?
private void echo() throws IOException {
try (FileReader fileReader = new FileReader("zoo-data.txt");
BufferedReader bufferedReader = new BufferedReader(fileReader)) {
System.out.println(bufferedReader.readLine());
}
}
  • A. It prints the first line of the file to the console.
  • B. It prints the entire contents of the file.
  • C. The code does not compile because the reader is not closed.
  • D. The code does compile, but the reader is not closed.
  • E. The code does not compile for another reason.
  • 正确答案: A 你的答案: D
  • [解析]This code compiles and runs without issue, so C and E are incorrect. It uses a try-with- resource block to open the FileReader and BufferedReader objects. Therefore, both get closed automatically, and D is incorrect. The body of the try block reads in the first line of the file and outputs it to the user. Therefore, A is correct. Since the rest of the file is not read, B is incorrect.
  • 4.如果有以下代码段:
Thread thread = new Thread(new ________________() {
public void run() {...}
});
  • 空白部分指定哪些类型可以通过编译?
  • A. Runnable
  • B. Thread
  • C. Future
  • D. Executor

结对及互评

点评过的同学博客和代码

学习进度条

代码行数(新增/累积) 博客量(新增/累积) 学习时间(新增/累积) 重要成长
目标 5000行 30篇 400小时
第一周 45/45 1/1 15/15
第二周 288/333 2/3 21/31
第三周 513/846 1/4 11/42
第四周 531/1377 1/5 12/54
第五周 821/2198 1/6 15/69
第六周 609/2807 1/7 10/79
第七周 1/8 10/89
  • 计划学习时间:10小时

  • 实际学习时间:10小时

  • 改进情况:

(有空多看看现代软件工程 课件

软件工程师能力自我评价表
)

参考资料

20155316 2016-2017-2 《Java程序设计》第7周学习总结的更多相关文章

  1. 20155304 2016-2017-2 《Java程序设计》第九周学习总结

    20155304 2016-2017-2 <Java程序设计>第九周学习总结 教材学习内容总结 JDBC简介 撰写应用程序是利用通信协议对数据库进行指令交换,以进行数据的增删查找 JDBC ...

  2. 20155330 2016-2017-2 《Java程序设计》第九周学习总结

    20155330 2016-2017-2 <Java程序设计>第九周学习总结 教材学习内容总结 学习目标 了解JDBC架构 掌握JDBC架构 掌握反射与ClassLoader 了解自定义泛 ...

  3. 20145213《Java程序设计》第九周学习总结

    20145213<Java程序设计>第九周学习总结 教材学习总结 "五一"假期过得太快,就像龙卷风.没有一点点防备,就与Java博客撞个满怀.在这个普天同庆的节日里,根 ...

  4. 20145213《Java程序设计》第二周学习总结

    20145213<Java程序设计>第二周学习总结 教材学习内容总结 本周娄老师给的任务是学习教材的第三章--基础语法.其实我觉得还蛮轻松的,因为在翻开厚重的书本,一股熟悉的气息扑面而来, ...

  5. 20145213《Java程序设计》第一周学习总结

    20145213<Java程序设计>第一周学习总结 教材学习内容总结 期待了一个寒假,终于见识到了神秘的娄老师和他的Java课.虽说算不上金风玉露一相逢,没有胜却人间无数也是情理之中,但娄 ...

  6. 21045308刘昊阳 《Java程序设计》第九周学习总结

    21045308刘昊阳 <Java程序设计>第九周学习总结 教材学习内容总结 第16章 整合数据库 16.1 JDBC入门 16.1.1 JDBC简介 数据库本身是个独立运行的应用程序 撰 ...

  7. 20145330孙文馨 《Java程序设计》第一周学习总结

    20145330孙文馨 <Java程序设计>第一周学习总结 教材学习内容总结 刚开始拿到这么厚一本书说没有压力是不可能的,开始从头看觉得很陌生进入不了状态,就稍微会有一点焦虑的感觉.于是就 ...

  8. 20145337 《Java程序设计》第九周学习总结

    20145337 <Java程序设计>第九周学习总结 教材学习内容总结 数据库本身是个独立运行的应用程序 撰写应用程序是利用通信协议对数据库进行指令交换,以进行数据的增删查找 JDBC可以 ...

  9. 20145337 《Java程序设计》第二周学习总结

    20145337 <Java程序设计>第二周学习总结 教材学习内容总结 Java可分基本类型与类类型: 基本类型分整数(short.int.long).字节(byte).浮点数(float ...

  10. 20145218《Java程序设计》第一周学习总结

    20145218 <Java程序设计>第一周学习总结 教材学习内容总结 今天下午看了Java学习的视频,感觉很是新奇,之前觉得Java学起来是艰难枯燥的,但通过第一章的学习觉得如果自己可以 ...

随机推荐

  1. 简单 dp

    1.摆花问题 题目描述小明的花店新开张,为了吸引顾客,他想在花店的门口摆上一排花,共m盆.通过调查顾客的喜好,小明列出了顾客最喜欢的n种花,从1到n标号.为了在门口展出更多种花,规定第i种花不能超过a ...

  2. jQ返回定位插件

    一.jQuery 提供开发者开发插件的几种模式 1.$.extend();     //这个方法是绑定在$上面的.可以通过$直接调用 2.$.fn.方法名     //这个方法是绑定在Dom对象上面的 ...

  3. PBS命令和使用

    PBS是公开源代码的作业管理系统,在此环境下运行,用户不需要指定程序在哪些节点上运行,程序所需的硬件资源由PBS管理和分配. PBS(Portable Batch System)是由NASA开发的灵活 ...

  4. [转帖]CentOS基础命令大全

    https://www.toutiao.com/i6601298434651587085/ 1.关机 (系统的关机.重启以及登出 ) 的命令 shutdown -h now 关闭系统(1) init ...

  5. docker weave安装

    1.升级内核到3.10.0以上,安装iproute22.安装 0.80版本:#wget -O /usr/local/bin/weave https://raw.githubusercontent.co ...

  6. DataTable List 相互转换

    This uses the FastMember's meta-programming API for maximum performance. If you want to restrict it ...

  7. 通过ClientDataSet复制表的结构及数据

    1.  需要2个ClientDataSet组件: 2.  clientDataSet1连接目标表,clientDataSet2连接源表,如果无法直接连接,使用DataSetProvider进行桥接: ...

  8. Codechef_JULY14

    感觉这套比赛题目比较容易,没有以前做过的某次codechef那么凶残.题目还是很有意思的,最好的是有中文翻译. CSUB:签到题,直接从左往右扫一遍即可,维护前面出现过多少个1. #include & ...

  9. shell的sort命令

    sort命令以行为单位对文本进行排序. 命令语法: sort [-b/d/f/g/i/M/n/r] [InFile] 参数解释: -b: ignore-leading-blanks,忽略前面空格符部分 ...

  10. The Best Path HDU - 5883(欧拉回路 && 欧拉路径)

    The Best Path Time Limit: 9000/3000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Tot ...