Quiz Section4 Java Fundamental
Quiz Section4 Java Fundamental
When importing another package into a class you must import only the package
classes that will be called and not the entire package. True or false? False (*)
2. Which of the following defines a driver class? Contains a main method and other
static methods. (*)
3. The following defines a class keyword: Precedes the name of the class. (*)
4. When importing another package into a class you must import the entire
package as well as the package classes that will be called. True or False? False
(*)
5. Eclipse does not provide views to help you navigate a hierarchy of information.
True or False? False (*)
6. In a project, 1 of the classes must contain a main method. True or False? True (*)
7. The ______________ is the location into which you will store and save your files.
Workspace (*)
8. Given the code
String s1 = "abcdef";
String s2 = "abcdef";
String s3 = new String(s1);
Which of the following would equate to false? s3 == s1 (*)
9. The following program prints "Equal". True or false?
True (*)
10.Consider the following code snippet. What is printed?
87668 (*)
11.Consider the following:
You are writing a class and are using a global variable. Inside a method you
declare a local variable with the same name as the global variable.
This programming style is poor because inside the method the global variable
will have precedence over the local variable with the same name.
True or false? False (*)
12.What does the following program output?
False (*)