Today in a company (not disclosed) wrote a set of Java face questions. There is a question about this.
Which design pattern used in Java.lang.Runtime?
So what design pattern is used in the java.lang.Runtime?
And what design patterns are used in java.utils.collection.
At that time because of this unpopular knowledge not enough, and the API also read less, so a short answer.
back home and searched the next.
For:
Runtiome.
Single case mode.
1 each Java program has a single instance of the runtime class.
2 Obtain an instance of the runtime class by Runtime.getruntime ().
3) The runtime class is an example of using a single example pattern.
Collection.
Adorner mode.
For example:
ArrayList Package Builder
Public ArrayList (collection<? extends e> c) {...}
LinkedList Package Builder
Public LinkedList (collection<? extends e> c) {...}
HashSet Packaging builder Publichashset (collection<? extends e> c) {...}