Download 1. A folder or directory that provides a convenient grouping for

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
1. A folder or directory that provides a convenient grouping for related classes is called a A.
superclass B. collection C. package D. DLL (Dynamic Link Library)
2. The portion of a program within which you can reference a variable is known as that
variable’s A. declaration B. range C. scope D. block
3. Writing multiple methods with the same name, but different arguments is known as A. nesting
B. overloading C. overriding D. variable casting
4. When there’s an overloaded method, and the compiler can’t determine which method to use,
it’s known as a/an ____ method A. ambiguous B. anonymous C. out-of-range D. explicit
5. Methods that are associated with all objects in a class are called A. class variables B. class
methods C. class identifiers D. main methods
6. Which of the following classes is included automatically in any program you write? A.
java.util B. java.AWT C. java.lang D. java.date
7. What is the name of the package in which all of Java’s pre-written mathematical functions are
contained? A. java.math.* B. java.Util.math C. java.lang.math D. java.lang.Math
8. A variable declared as final means that A. no more variables will be declared within the
program B. the variable is a symbolic constant C. the variable is a string type D. the variable is
the last variable in the program
9. Which of the following procedures will not allow you to use a pre-written class (with the
exception of java.lang)? A. Importing the class into your program B. Using the entire path with
the class name in your program C. Invoking the class library from your browser D. Importing
the package that includes the class
10. You can use the keyword final with A. methods only B. classes only C. methods and
classes D. constants only
11. Methods that have identical arguments lists but different return types are A. overloaded B.
overridden C. illegal D. ambiguous
12. If a second block of code is contained within a first block of code, the blocks of code are said
to be A. overloaded B. ambiguous C. nested D. overridden
13. A variable that’s shared by every instantiation of a class is known as A. a class variable B. a
nested variable C. an instance variable D. the this reference
14. Two programming students are discussing the java.lang.Math class library. Student A says
that you can’t instantiate object of type Math because the constructor for the Math class is
private, and your programs can’t access the constructor. Student B says that since all of the
constants and methods in the Math class are class-wide, you don’t need to create an instance.
Which student is correct? A. Student A B. Student B C. Student A and Student B D. Neither
student is correct
15. Which of the following statements about Date is not true? A. Date is a class that you may
import B. Date is a reserved java keyword C. A date object can be constructed with a number
of different arguments D. You may write you own Date class
16. What arguments would you use to complete the statement Date = new Date (); for the date
July 4, 2001? A. (101, 6, 4) B. (2001, 7, 4) C. (101, 7, 4) D. (001, 4, 7)
17. What does the Java language consider to be the current moment? A. The actual time on the
computer when the program asks for it B. The number of microseconds elapsed since midnight
January 1, 2000 C. The correct date and time from the U.S. Naval Observatory Web site D. The
number of milliseconds elapsed since midnight January 1, 1970
18. How does the Java compiler deal with an invalid date? A. it generates an error B. It uses the
invalid date just as written C. It interprets the invalid date as the appropriate correct date D.
It compiles the program, but causes a runtime error when the invalid date is accessed
19. Which of the following import statements is written correctly? A. import java.lang.Math; B.
import java.util.Date; C. import java.Util.date; D. import Java.util.*: (the colon is not a
mistake)
20. Two Java students are discussing how the import statement works within Java. Student A
says that the import statement moves the entire class or package into the program, just like the
name says. Student B says that the import statement simply notifies the program that you’ll be
using the data and method names that are part of the class or package named in the import
statement. Which student is correct? A. Only Student A B. Only Student B C. Student A and
Student B D. Neither student is correct