1

in my scala code i have the following

trait A
object A {
  case object AB extends A
  case object AC extends A
}

how can i access AB or AC from java code? i expected it to work like A.AB, but that does not work.

i also saw this: How do I "get" a Scala case object from Java? however, somewhere else I read, that you should never use $ stuff in java code.

all I want to do in Java is to check if an object is of type AB or AC.

how can this be done in this case?

Community
  • 1
  • 1
beta
  • 5,324
  • 15
  • 57
  • 99

0 Answers0