The usage of `getClass` method in Scala/Java? -
i find works (scala codes)
class myclass(i:int) { } val = new myclass(1) but doesn't work:
val b = a.getclass val c = new b(1) the compiler cannot resolve "b".
does have ideas this? difference between b , myclass here? mean myclass not object, while b object?
myclass type. b value (or term) of type java.lang.class. new requires former kind.
Comments
Post a Comment