countElements

fun countElements(objects: List<*>, targetClass: Class<*>): Int

Returns a count of the elements that are of the same type as the target class.

Return

a list that holds the items of the targetClass

Parameters

objects

the list that can hold anything

targetClass

the class type to find in the list, should be same as T