1) An enum essentially behaves like: a) An array b) A class that contains instan
ID: 3547942 • Letter: 1
Question
1) An enum essentially behaves like:
a) An array
b) A class that contains instance variables.
c) A class that contains static constants.
2) Enum constructors cannot be:
a) wibbly
b) abstract
c) private
d) public
3) which of the following access modifiers cannot be aplied to metthod?
a) public
b) int
c) protected
d) default (i.e. no modifier)
4) Which of the following types cannot be used on an instance variable?
a) void
b) float
c) string
d) int
5) Which of these uses does the this keyword have?
a) To make an abstract class.
b) To call a superconstructor.
c) To unambiguously refer to a field.
d) To call a constructor.
e) To call a method.
6) Changing the behavior of an inherited method in a derived class is called
a) Overriding
b) Overloading
Registering an event listener with the source component
Overriding the hashCode() method
c) Using a Timer
d) Adding a method to the source component
a) An array
b) A class that contains instance variables.
c) A class that contains static constants.
2) Enum constructors cannot be:
a) wibbly
b) abstract
c) private
d) public
3) which of the following access modifiers cannot be aplied to metthod?
a) public
b) int
c) protected
d) default (i.e. no modifier)
4) Which of the following types cannot be used on an instance variable?
a) void
b) float
c) string
d) int
5) Which of these uses does the this keyword have?
a) To make an abstract class.
b) To call a superconstructor.
c) To unambiguously refer to a field.
d) To call a constructor.
e) To call a method.
6) Changing the behavior of an inherited method in a derived class is called
a) Overriding
b) Overloading
d) Overcharging
7) Can a try block be followed by a finally block without a catch block?
a) true
b) false.
8) If you need to perform an enormous amount of String concatenations, the efficient way is to use the class rather than String class.
9) Methods in an interface are always:
a) timed
b) public
c) abstract
d) synchronized
e) void
10) The safe way to check if two strings are identical is to use
a) the == operator
b) the equals() method
c) The = operator
11) In Swing, events are handled by a)
Registering an event listener with the source component
b)Overriding the hashCode() method
c) Using a Timer
d) Adding a method to the source component
Explanation / Answer
1.d
2.c
3.d
4.a
5.b
6.c
7.a
7.b
9.d
10.b
11.a
12.c
13.d
14.b
15.c
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.