Mixing Java code in Scala program?

后端 未结 2 506
心在旅途
心在旅途 2021-01-12 10:28

Is this allowed in Scala code:

DomNode node = node.getFirstChild()

where DomNode is Java type from external java library and getFirstChild(

2条回答
  •  迷失自我
    2021-01-12 10:43

    IntelliJ IDEA can translate from Java to Scala for you. If you paste Java code into a ".scala" file IntelliJ IDEA notices it and asks you if you would like to try an automatic conversion. You might wanna check it out.

    PS

    I never tried it out myself...

提交回复
热议问题