- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
passing a Class as value (java vs scala)
Tue, 2009-02-03, 22:00
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
Hi,
In Java, I can do something like ... aclass.getConstructor(AnotherClass.class), what would be the simplest equivalent in Scala ?
I know I can do it like this : aclass.getConstructor(Class.forName("AnotherClass"))
Thanks,
S.
Hi,
In Java, I can do something like ... aclass.getConstructor(AnotherClass.class), what would be the simplest equivalent in Scala ?
I know I can do it like this : aclass.getConstructor(Class.forName("AnotherClass"))
Thanks,
S.
Skeptic 2000 wrote:
> In Java, I can do something like ...
> aclass.getConstructor(AnotherClass.class), what would be the simplest
> equivalent in Scala ?
>
> I know I can do it like this :
> aclass.getConstructor(Class.forName("AnotherClass"))
aclass.getConstructor(classOf[AnotherClass])
-0xe1a