Using Java Generics in Scala -
when integrating java library scala codebase, running following error when uisng 1 of generic objects java scala.
val myobject<someotherclass> = myobject.factorymethod()
above code gives compilation error because not valid scala statement.
how can use java generic objects in scala codebase.
val myobject: myobject[t] = myobject.factorymethod ()
would scala-syntax. note objects written in lower case. type inference might solve issue without giving type explicitly, might idea documentation reasons specify though, , error, if reasoning wrong.
Comments
Post a Comment