for (j=0; j < list.length; j++)html
if (list[j] < temp) c++;java
A . It finds the smallest value and stores it in temp
B . It finds the largest value and stores it in temp
C . It counts the number of elements equal to the smallest value in list
D . It counts the number of elements in list that are less than temp
E . It sorts the values in list to be in ascending order
答案:D。if(list[j]<temp)c++;语句将list中的每一个元素与temp进行比较,而且仅当元素小于temp时才将一个元素添加到c中,所以它计算list中小于temp的元素数,并将结果存储在c中。>c++
A . true
B . false
答案:B。决定调用哪一个方法的是对象的类型,而不是引用的类型。git
A . true
B . false
答案:A。这是使用类名声明引用变量的多态函数之一。程序员
A . true
B . false
答案:A。大多数其余搜索技术都要求对其数据进行排序,以便得到更高的效率(速度)。可是,线性搜索没有这样的要求。结果是,线性搜索可能比人们指望的要慢,但它老是有效的,并且人们在搜索数据以前不须要支付排序数据的(昂贵的)代价。算法
A . true
B . false
答案:B。只有对数据进行排序时,二进制搜索才起做用。二进制搜索算法经过假设每对数据元素之间有严格的关系来进行,不管是升序仍是降序。若是没有这个顺序,二进制搜索将没法正常工做。数据结构
A . the active methods in the order that they were invoked
B . the active methods in the opposite order that they were invoked
C . the values of all instance data of the object where the exception was raised
D . the values of all instance data of the object where the exception was raised and all local variables and parameters of the method where the exception was raised
E . the name of the exception thrown
答案:B。调用堆栈跟踪提供存储在运行时堆栈上的方法的名称。方法名从堆栈中移除的顺序与它们的放置顺序相反,也就是说,最先的方法首先放置在堆栈中,下一个方法第二个放置在堆栈中,以此类推,以便最近调用的方法是堆栈中的最后一个项,所以它是第一个移除的项。堆栈跟踪而后按调用它们的相反顺序显示全部活动方法(最新的先显示)。less
A . Error
B . Exception
C . RuntimeException
D . IllegalAccessException
E . CheckedException
答案:C。这两个异常都是RuntimeException的子级,RuntimeException自己是Exception的子级。error是一个可丢弃的对象,它不一样于exception,而illegalaccessexception和checkedeexception是exception的子级,但不是runtimeexception。函数
A . throw
B . throws
C . try
D . Throwable
E . goto
答案:A。保留字throw用于在检测到异常时引起异常,如:if(score<0)throw new illegalTestScoreException(“input score”+score+“is negative”);>学习
A . has both print and println methods and PrintStream only has print
B . can output both byte and character streams and PrintStream can only output byte streams
C . has error checking mechanisms as part of the class and PrintStream does not
D . will not throw checked exceptions and PrintStream will
E . all of the above
答案:C。printwriter类是writer类,而printstream类是stream类。主要的区别在于,printwriter是专门为文件设计的,所以有错误检查机制,这些机制不是printstream的一部分。
A . checked exceptions need not be listed in a throws clause
B . unchecked exceptions must be listed in a throws clause
C . neither kind of exception follows the rules of exception propagation
D . an unchecked exception requires no throws clause
E . a checked exception always must be caught by a try block; an unchecked exception does not
答案:D。必须捕获选中的异常,或者必须将其列在throws子句中。未检查的异常不须要throws子句。这两种异常都遵循异常传播的规则。
A . true
B . false
答案:A。异常是敏感的事件,或者是在没有异常处理程序的状况下没法正常处理的运行时状况。异常由关联的异常处理程序捕获。若是抛出异常但未处理,则程序必须终止。
A . true
B . false
答案:A。全部try语句必须至少有一个catch语句,不然没有理由使用try语句。对于可能引起的每种类型的异常,均可以有一个catch语句。程序员能够根据须要指定任意多个catch语句。此外,try语句可能有finally子句,但不须要。
代码行数(新增/累积) | 博客量(新增/累积) | 学习时间(新增/累积) | 重要成长 | |
---|---|---|---|---|
目标 | 10000行 | 30篇 | 400小时 | |
第一周 | 138/138 | 2/2 | 25/25 | 学会写和上传代码,会编简单的输出程序 |
第二周 | 88/226 | 1/3 | 30/55 | 起文件名不能太长 |
第三周 | 898/1124 | 2/5 | 35/90 | Java类里面的方法和C语言的函数很像 |
第四周 | 632/1756 | 2/7 | 30/120 | 能够用继承extends简化重复的代码 |
第五周 | 770/2526 | 2/9 | 45/165 | --amend -m能够重命名没push的文件 |
第六周 | 3947/6473 | 2/11 | 40/205 | 接口类的功能要分散,利用多继承完成功能 |