Quiz
Answer the following questions to test your knowledge of this chapter:
- Select all the correct statements:
- Idioms can be used to communicate the code’s intent.
- Idioms can be used to explain what the code does.
- Idioms can be misused and obscure the topic of conversation.
- Idioms should be avoided to express the idea clearly.
- Is it necessary to implement
hasCode()
every timeequals()
is implemented? - If
obj1.compareTo(obj2)
returns a negative value, what does this mean? - Does the deep copy notion apply to a primitive value during cloning?
- Which is faster,
StringBuffer
orStringBuilder
? - What are the benefits of coding to an interface?
- What are the benefits of using composition versus inheritance?
- What is the advantage of using libraries versus writing your own code?
- Who is the target audience of your code?
- Is testing required?