
Day 10 - Inner class
Quiz
•
Professional Development
•
Professional Development
•
Practice Problem
•
Hard
Nirmala Sherine
Used 8+ times
FREE Resource
Student preview

5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is true about an anonymous inner class?
It can extend exactly one class and implement exactly one interface.
It can extend exactly one class and can implement multiple interfaces.
It can extend exactly one class or implement exactly one interface.
It can implement multiple interfaces regardless of whether it also extends a class.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which statement is true about a static nested class?
You must have a reference to an instance of the enclosing class in order to instantiate it.
It does not have access to nonstatic members of the enclosing class.
It's variables and methods must be static.
It must extend the enclosing class.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Foo
{
class Bar{ }
}
class Test
{
public static void main (String [] args)
{
Foo f = new Foo();
/* Line 10: Missing statement ? */
}
}
which statement, inserted at line 10, creates an instance of Bar?
class Foo
{
class Bar{ }
}
class Test
{
public static void main (String [] args)
{
Foo f = new Foo();
/* Line 10: Missing statement ? */
}
}
which statement, inserted at line 10, creates an instance of Bar?Foo.Bar b = new Foo.Bar();
Foo.Bar b = f.new Bar();
Bar b = new f.Bar();
Bar b = f.new Bar();
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class MyOuter
{
public static class MyInner
{
public static void foo() { }
}
}
which statement, if placed in a class other than MyOuter or MyInner,
instantiates an instance of the nested class?
public class MyOuter
{
public static class MyInner
{
public static void foo() { }
}
}
which statement, if placed in a class other than MyOuter or MyInner,
instantiates an instance of the nested class?MyOuter.MyInner m = new MyOuter.MyInner();
MyOuter.MyInner m = new MyOuter.MyInner();
MyOuter m = new MyOuter();
MyOuter.MyInner mi = m.new MyOuter.MyInner();
MyOuter m = new MyOuter();
MyOuter.MyInner mi = m.new MyOuter.MyInner();
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which among the following best describes a nested class?
Class inside a function
Class inside a package
Class inside a structure
Class inside a class
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?
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Professional Development
20 questions
Black History Month Trivia Game #1
Quiz
•
Professional Development
100 questions
Screening Test Customer Service
Quiz
•
Professional Development
20 questions
90s Cartoons
Quiz
•
Professional Development
10 questions
Reading a ruler in Inches
Quiz
•
4th Grade - Professio...
16 questions
Parallel, Perpendicular, and Intersecting Lines
Quiz
•
KG - Professional Dev...
12 questions
Valentines Day Trivia
Quiz
•
Professional Development