Science, asked by Jana8230, 1 year ago

Explain the concept and usage of an extractor in Scala?

Answers

Answered by ry5107742
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