2

In scala environment, I use java class containing method type() which seems to cause troubles as type is a scala keyword.

I need to call the real type method (defined in java class), not the scala one.

val c = new JavaClass(...)
val s = new ScalaClass(c.type(), c.name())
// identifier expected but 'type' found.

Can I somehow call the type method defined in java class?

Note: I can't rewrite the java class since it's a provided library without edit permission.

om-nom-nom
  • 62,329
  • 13
  • 183
  • 228
petrbel
  • 2,428
  • 5
  • 29
  • 49

1 Answers1

4

you can call the java method by surrounding it with backtics

c.`type`()
maasg
  • 37,100
  • 11
  • 88
  • 115