-1

What different between

scala.collection.immutable.List$SerializationProxy 

and

scala.collection.immutable.List 

in Scala 2.11 ?

Haha TTpro
  • 5,137
  • 6
  • 45
  • 71

1 Answers1

2

List$SerializationProxy is a helper class that is used by List to implement the Serialization Proxy Pattern

You can see some discussion about this in the source code, List.scala:415

// Create a proxy for Java serialization that allows us to avoid mutation
// during deserialization.  This is the Serialization Proxy Pattern.
protected final def writeReplace(): AnyRef = new List.SerializationProxy(this)

You do not need to use or interact with List$SerializationProxy as a normal user of Scala, it is an implementation detail.

Rich
  • 15,048
  • 2
  • 66
  • 119