Scala – Generic Types

  • date 18th February, 2021 |
  • by Prwatech |
  • 0 Comments

For a Specific Type

 

Now the compiler guarantees that the course item in someOffer can only be an Prwatech instance.

Without Type-Safety

 

 

Type safety with Generic Classes

When declaring a class in Scala, we can specify type parameters. We use square brackets to surround these type parameters.

 

0
0

Quick Support

image image