这一章主要是对数组的学习:html
问题1解决方案:在尝试使用了break后成功运行。这也是第一次开始使用break,之前都是使用if和else而没有尝试过这一种。
java
问题2解决方案:我将我定义的第一个数组显示结果删掉,最后显示了正确结果。
git
问题3解决方案: 定义的时候刚开始在找数组,后面发现int型的运用不正确,所有改成double型后成功解决了问题。编程
将第五周和第六周错题弄反了,本次为第五周错题
数组
问题1:Which of the following reserved words in Java is used to create an instance of a class?
A.class
B.public
C.public or private, either could be used
D.import
E.new
保留字“new”用于实例化一个对象,声明new后面跟着的是类名,这就是类的构造方法。如
Car x = new Car( );将会实例化一个car类,并赋予一个变量X。数据结构
问题2:Instance data for a Java class
A.are limited to primitive types (e.g., int, float, char)
B.are limited to Strings
C.are limited to objects(e.g., Strings, classes defined by other programmers)
D.may be primitive types or objects, but objects must be defined to be private
E.may be primitive types or objects
实例数据是组成类的实体,它能够是任何可用的类型,不管是原始的仍是对象的,public型仍是private型。app
问题3:During program development, software requirements specify
A.how the program will accomplish the task
B.what the task is that the program must perform
C.how to divide the task into subtasks
D.how to test the program when it is done
E.all of the above
软件需求指定了程序必须完成的功能,指明了程序应当执行的任务,而不是描述如何执行所规定的任务。一般,任务需求用一个称为功能说明的文档来描述。编程语言
问题4:Java does not support multiple inheritance, but some of the abilities of multiple inheritance are available by
A.importing classes
B.implementing interfaces
C.overriding parent class methods
D.creating aliases
E.using public rather than protected or private modifiers
因为类能够实现任意数量的接口,因此该类本质上是使用接口类,就好像这些接口是在该类中定义的那样。所以,该类继承了接口的方法和常量。此外,该类还能够扩展另外一类,从而直接或间接地从多个类继承。这与多重继承并不彻底相同,但它与Java的概念很是接近。ide
问题5:The goal of testing is to
A.ensure that the software has no errors
B.find syntax errors
C.find logical and run-time errors
D.evaluate how well the software meets the original requirements
E.give out-of-work programmers something to do
测试是必需的,由于全部的软件都有错误。复杂的系统在发布以前尤为须要测试。所寻找的错误类型是逻辑错误和运行时错误。全部的语法错误都将在实施过程当中被识别和修复。函数
问题6:Static methods cannot :
A . reference instance data
B . reference non-static instance data
C . reference other objects
D . invoke other static methods
E . invoke non-static methods
静态方法是类自己的一部分, 而不是实例化对象的方法, 所以静态方法在类的全部实例化对象之间共享。因为静态方法是共享的, 所以它没法访问非静态实例数据, 由于全部非静态实例数据都特定于实例化对象。
问题7:What happens if you declare a class constructor to have a void return type?
A . You'll likely receive a syntax error
B . The program will compile with a warning, but you'll get a runtime error
C . There's nothing wrong with declaring a constructor to be void
D . The class' default constructor will be used instead of the one you're declaring
E . None of the above
加void类型并无语法错误,只是否是构造函数而是一个普通的函数了,可是每个函数里都有构造函数,若是本身加了void类型后也只会是出现一个空的构造函数而非产生语法错误。
问题8:Formal parameters are those that appear in the method call and actual parameters are those that appear in the method header.
A . true
B . false
问题有两个定义颠倒了。形式参数是出如今方法头中的形参, 实际参数是方法调用中的参数 (传递给方法)。
问题9:Accessors and mutators provide mechanisms for controlled access to a well-encapsulated class.(存取器和突变器提供了对一个良好封装的类进行受控访问的机制。)
A true
B false
存取器提供对那些不然没法访问的变量的读访问。突变器提供对其余难以访问的变量的写访问权
问题10:Interface classes cannot be extended but classes that implement interfaces can be extended.
A true
B false
接口类不能被扩展,可是实现接口的类能够被扩展。a.真正的b.假 解释:任何类均可以被扩展,不管它是一个接口,仍是实现一个接口,或者二者都没有。惟一的例外是,若是该类被显式地用“final”这个词进行修饰,在这种状况下,它不能被扩展。
本周在课后项目编程时遇到了不少困难,课下仍是要将课本熟读。
代码行数(新增/累积) | 博客量(新增/累积) | 学习时间(新增/累积) | 重要成长 | |
---|---|---|---|---|
目标 | 5000行 | 30篇 | 400小时 | |
第一周 | 180/180 | 2/2 | 20/25 | |
第二周 | 312/414 | 2/4 | 20/45 | |
第三周 | 557/971 | 2/6 | 25/70 | |
第四周 | 1217/2242 | 2/8 | 44/114 | |
第五周 | 734/2976 | 2/10 | 24/138 | |
第六周 | 523/3509 | 2/12 | 20/158 |
计划学习时间:20小时
实际学习时间:20小时
改进状况:
commit的提交有了改进