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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -