题目内容

Assume that inputFile references a Scanner object that was used to open a file. Which of the following while loops shows the correct way to read data from t he file until the end of the file is reached?假设inputFile引用了Scanner对象。下列哪一项while循环显示了从文件读取数据直到到达文件结尾的正确方法?

A. while (inputFile != null){ … }
B. while (!inputFile.EOF){ … }
C. while (inputFile.hasNext()){ … }
D. while (inputFile.nextLine == " "){ … }

查看答案
更多问题

A constructor is a method that:构造函数是哪样一种方法。

A. returns an object of the class. 返回类的一个对象
B. never receives any arguments. 从来没有收到任何参数
C. with the name ClassName.constructor. ClassName.constructor名称
D. performs initialization or setup operations. 执行初始化或设置操作

A class’s responsibilities include:一个类的功能包括:

A. the things a class is responsible for doing 类负责做的事情
B. the things a class is responsible for knowing 一个类负责了解的东西
C. both A and BA和B都是
D. neither A or B

This is a group of related classes.以下哪个是一组相关的类

A. archive 存档
B. package 包
C. collection 集合
D. attachment 附件

Quite often you have to use this statement to make a group of classes available to a program.你必须使用此语句才能使一组类对程序可用。

A. import
B. use
C. link
D. assume 假设

答案查题题库