I have scenario where dynamically creating reflection class objects ., so in this case we want to create array which can be capable to handle reflection class objects .
I tried with val emptyArray = Array.empty[AnyVal] . and val emptyArray = Array.empty[Anyl] this basically are capable to handle datatype objects… but where i am forward looking to cast this objects to class object
any help would be appreciated wrt
-
how to create empty array without specifying datatype
-
how to create reflection class objects where objects being initialised in this manner
this is for single object
val scn = Class.forName(script1).newInstance.asInstanceOf[{ def call( env:String) : (customClass1,customClass2) }]
but not able to figure how to handle if i want to create array of scn