
eight nine ten ten
Authored by NUrken AtAbAy
Professional Development

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
41 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which are true about a static nested class? (Choose all that apply.)
A. You must have a reference to an instance of the enclosing class in order to instantiate it
B. It does not have access to non-static members of the enclosing class
C. Its variables and methods must be static
D. If the outer class is named MyOuter, and the nested class is named MyInner, it can be instantiated using new MyOuter.MyInner();
E. It must extend the enclosing class
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which create an anonymous inner class from within class Bar? (Choose all that apply.)
A. Boo f = new Boo(24) { };
B. Boo f = new Bar() { };
C. Boo f = new Boo() {String s; };
D. Bar f = new Boo(String s) { };
E. Boo f = new Boo.Bar(String s) { };
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which are true about a method-local inner class? (Choose all that apply.)
A. It must be marked final
B. It can be marked abstract
C. It can be marked public
D. It can be marked static
E. It can access private members of the enclosing class
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result?
A. An exception occurs at runtime
B. true
C. fred
F. Compilation fails because of an error on line 8
G. Compilation fails because of an error on a line other than 3, 4, or 8
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result?
A. An exception occurs at runtime at line 10
B. Zippo
C. Compilation fails because of an error on line 3
D. Compilation fails because of an error on line 9
E. Compilation fails because of an error on line 10
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result?
A. 57 22
B. 45 38
C. 45 57
D. An exception occurs at runtime
E. Compilation fails
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which, inserted independently at line 6, compile and produce the output "spooky"? (Choose all that apply.)
A. Sanctum s = c.new Sanctum();
B. c.Sanctum s = c.new Sanctum();
C. c.Sanctum s = Cathedral.new Sanctum();
D. Cathedral.Sanctum s = c.new Sanctum();
E. Cathedral.Sanctum s = Cathedral.new Sanctum();
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?