【问题标题】:passing current class as argument in scala在scala中将当前类作为参数传递
【发布时间】:2011-06-19 23:47:19
【问题描述】:

如何将当前类作为参数传递?在java中我们这样做:

mymethod (this.class)  

mymethod (MyClass.class)

如何将 scala 当前类传递给此方法?

【问题讨论】:

标签: scala


【解决方案1】:

this.getClassclassOf[MyClass]

【讨论】:

    猜你喜欢
    • 2012-12-17
    • 2015-03-22
    • 2016-08-07
    • 1970-01-01
    • 2016-09-12
    • 1970-01-01
    • 2023-04-01
    • 2012-04-29
    • 1970-01-01
    相关资源
    最近更新 更多