Escolar Documentos
Profissional Documentos
Cultura Documentos
Question 1
Suppose these are top-level class declarations and not nested class declarations; and suppose that all of the declarations are contained
in one file named Basics.java. Compile-time errors are generated at which lines?
a. 1
b. 2
c. 3
d. 4
e. 5
Question 2
Suppose these are top-level class declarations and not nested class declarations; and suppose that all of the declarations are contained
in one file named Basics.java. A compile-time error is not generated at which line?
a. 1
b. 2
c. 3
d. 4
e. None of the above
Question 3
Which of the following modifiers can be applied to a class that is not a nested class?
a. public
b. protected
c. private
d. abstract
e. static
f. final
Question 4
Question 5
page:1
Class Declarations Questions
Question 6
abstract class A {} // 1
transient class G {} // 2
private class C {} // 3
static class E {} // 4
Suppose these are top-level class declarations and not nested class declarations. Which of these declarations would not produce a
compile-time error?
a. 1
b. 2
c. 3
d. 4
e. None of the above
Question 7
protected class D {} // 1
synchronized class F {} // 2
volatile class H {} // 3
final class B {} // 4
Suppose these are top-level class declarations and not nested class declarations. Which of these declarations would not produce a
compile-time error?
a. 1
b. 2
c. 3
d. 4
e. None of the above
Answers
page:2
Class Declarations Questions
page:3