My function must take a list of values as argument, convert each one to string and add them to a list.
The values can be either String
, Int
or Boolean
.
How to define a function with the flexibility to handle the different types? Here is my initial function but as expected when i give int as argument, i get an type mismatch error
def test (s: String*): List[String] = {
s.toList
}