Explain the concept and usage of an extractor in Scala?
Answers
Answered by
0
An extractor object is an object with an unapply method. Whereas the apply method is like a constructor which takes arguments and creates an object, the unapply takes an object and tries to give back the arguments. This is most often used in pattern matching and partial functions.
Similar questions