Log in
Sign up for FREE
arrow_back
Library
Interfaces Quiz
By Mickey Arnold
star
star
star
star
star
Share
share
Last updated almost 2 years ago
10 questions
Add this activity
1
1
1
1
1
1
1
1
1
1
Question 1
1.
A class that implements
Comparable
must implement how many methods at minimum?
public interface Comparable
{
public abstract int compareTo();
}
3
1
4
0
2
Question 2
2.
A class that implements
Wile
must implement how many methods at minimum?
public interface Wile
{
public abstract int go();
public abstract double stop( int x );
}
2
3
4
1
0
Question 3
3.
All methods located inside of an interface are automatically set with what access?
A and B only
A. public
C. protected
B. private
A, B, and C
Question 4
4.
Which of the following could fill <blank 1>?
public interface Quiz
{
<blank 1>
}
B. public double getScore();
A. double getScore();
C. public abstract double getScore();
A and B only
A, B, and C
Question 5
5.
Which of the following could NOT fill <blank 1>?
public interface Quiz
{
<blank 1>
}
B. void setScore(double s);
A and B only
A, B, and C
A. private void setScore(double s);
C. abstract void setScore(double s);
Question 6
6.
All variables located inside of an interface are automatically set with what access?
A, B, and C
B. private
A. public
A and B only
C. protected
Question 7
7.
All variables located inside of an interface are automatically labeled with which of the following modifiers?
C. final
C only
B. abstract
A and C only
A. static
Question 8
8.
Which of the following could fill <blank 1>?
public interface Bucket
{
<blank 1>
}
A. int x;
A, B, and C
B and C only
C. double y = 29;
B. int x = 2.6;
Question 9
9.
Which of the following could fill <blank 1>?
public interface Plane
{
<blank 1>
}
A, B, and C
C. final double y = 39;
B. final int x = 3.6;
A. final int x;
B and C only
Question 10
10.
Which of the following can implement an interface?
A. Abstract Class
B. Class
C. Interface
A and B only
A, B, and C