What is the difference between apply and unapply methods in scala?
Answer Posted / Nitin Gupta
The apply method is used to create a new instance of a case class, while the unapply method is used to deconstruct an instance of a case class. The apply method takes arguments and creates a new object, while the unapply method breaks down an existing object into its constituent parts.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers