79216520

Date: 2024-11-22 20:53:09
Score: 0.5
Natty:
Report link

Create an extension function:

fun <T : IMyBasicInterface> Class<T>.createGenericClass(param1: String): GenericClass<T> {
    return GenericClass<T>(param1)
}

And then use it like this:

interfacesSet.forEach { currentInterface ->
    val myObj = currentInterface.createGenericClass(param1)
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: kosert