You are on page 1of 3

Name ___________________ Period ________ Table __________

Interfaces Worksheet
Directions: Mark the letter of the best answer to each question.

____ 1. A class that implements Comparable must implement how many methods at minimum?

public interface Comparable


{
public abstract int compareTo();
}

a. 0
b. 1
c. 2
d. 3
e. 4

____ 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 );
}

a. 0
b. 1
c. 2
d. 3
e. 4

____ 3. All methods located inside of an interface are automatically set with what access?

a. public
b. private
c. protected
d. A and B only
e. A, B, and C

1
____ 4. Which of the following could fill <blank 1>?

public interface Quiz


{
<blank 1>
}

a. double getScore();
b. public double getScore();
c. public abstract double getScore();
d. A and B only
e. A, B, and C

____ 5. Which of the following could NOT fill <blank 1>?

public interface Quiz


{
<blank 1>
}

a. private void setScore(double s);


b. void setScore(double s);
c. abstract void setScore(double s);
d. A and B only
e. A, B, and C

____ 6. All variables located inside of an interface are automatically set with what access?

a. public
b. private
c. protected
d. A and B only
e. A, B, and C

____ 7. All variables located inside of an interface are automatically labeled with which of the
following modifiers?

a. static
b. abstract
c. final
d. A and C only
e. C only

2
____ 8. Which of the following could fill <blank 1>?

public interface Bucket


{
<blank 1>
}

a. int x;
b. int x = 2.6;
c. double y = 29;
d. B and C only
e. A, B, and C

____ 9. Which of the following could fill <blank 1>?

public interface Plane


{
<blank 1>
}

a. final int x;
b. final int x = 3.6;
c. final double y = 39;
d. B and C only
e. A, B, and C

____ 10. Which of the following can implement an interface?

a. Abstract Class d. A and B only


b. Class e. A, B, and C
c. Interface