Can someone explain this property with use cases by an example.
Asked
Active
Viewed 565 times
-1
-
question is too broad – Arun Sudhakaran Apr 03 '19 at 06:11
-
1putting it into some context, making your example more concrete will be better. like `list interface is backed by linked list` ... – Dyno Fu Apr 03 '19 at 06:11
-
1Do you mean [that](https://coderanch.com/t/591336/certification/Backed-Collection-java) ? – Dred Apr 03 '19 at 06:17
-
https://docs.oracle.com/javase/7/docs/api/java/util/Collections.html . I just read from the link written as "which return a new collection backed by a specified collection, and a few other odds and ends" – Apr 03 '19 at 06:19
-
5How is this too broad? It's clear what this question means and it has a fairly straightforward answer. Voted to reopen. – Dawood ibn Kareem Apr 03 '19 at 06:33
1 Answers
2
In the context of Collections
class (and some other class of the Java Collections Framework) it means that a Collection is a "wrapper" of another Collection: the inner class stores the data and the outer class adds some behavior that the inner one hasn't. An example are the methods of Collections
whose name starts with synchronized
or unmodifiable
: the method synchronizedList(List)
adds synchronization to any given List
, the method unmodifiableList(List)
makes any given List
unmodifiable and so on.
See also the Decorator Pattern.

Pino
- 7,468
- 6
- 50
- 69