Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Big Java Binder Early Objects
Quiz 10: Interfaces
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 1
Multiple Choice
____ methods must be implemented when using an interface.
Question 2
Multiple Choice
Consider the following code snippet: public class Inventory implements Measurable { ) . . Double getMeasure() ; { Return onHandCount; } } The compiler complains that the getMeasure method has a weaker access level than the Measurable interface. Why?
Question 3
Multiple Choice
Which of the following statements about interfaces is NOT true?
Question 4
Multiple Choice
Which of the following statements about a Java interface is NOT true?
Question 5
Multiple Choice
Which of the following statements about an interface is true?
Question 6
Multiple Choice
Consider the following code snippet. public interface Measurable { Double getMeasure() ; } Public class Coin implements Measurable { Public double getMeasure() { Return value; } ) .. } Public class DataSet { ) .. Public void add() { ) .. } } Public class BankAccount { ) .. Public void add() { ) .. } } Which of the following statements is correct?
Question 7
Multiple Choice
Consider the following code snippet: public class Inventory implements Measurable { ) . . Double getMeasure() ; { Return onHandCount; } } What is wrong with this code?
Question 8
Multiple Choice
Consider the following code snippet: public class Inventory implements Measurable { ) . . Public double getMeasure() ; { Return onHandCount; } } Why is it necessary to declare getMeasure as public ?
Question 9
Multiple Choice
Which of the following statements about abstract methods is true?
Question 10
Multiple Choice
Consider the following declarations: public interface Encryptable { Void encrypt(String key) ; } Public class SecretText implements Encryptable { Private String text; _____________________________ { // code to encrypt the text using encryption key goes here } } Which of the following method headers should be used to complete the SecretText class?
Question 11
Multiple Choice
To use an interface, a class header should include which of the following?
Question 12
Multiple Choice
____ can reduce the coupling between classes.
Question 13
Multiple Choice
Which statement about methods in an interface is true?
Question 14
Multiple Choice
Suppose you are writing an interface called Resizable, which includes one void method called resize. public interface Resizable { _________________________ } Which of the following can be used to complete the interface declaration correctly?