-
What are immutable objects most useful in?
Concurrent applications -
How do you create a new class that maps keys to values using the Collections Framework?
Extend from AbstractMap to implement the Map interface -
Given:
public abstract class Animal{…}
public class Dog extends Animal{…}
What allows you to use a parent class reference to refer to a child class object? For example:
Animal animal = new Dog();
Polymorphism 多态 /,pɒlɪ’mɔːfɪz(ə)m/
-
What effect does declaring a method as final have?
The method cannot be overridden in subclasses. -
What does the Object.wait() method do?
Causes the current thread to wait -
How can you stop your class from being inherited by another class?
Declare the class as final. -
Between the following options, which is the most efficient way to concatenate a large number