Groovy多行字符串有什么问题? - What's wrong with Groovy multi-line String?

问题:

Groovy scripts raises an error: Groovy脚本引发错误:

def a = "test"
  + "test"
  + "test"

Error: 错误:

No signature of method: java.lang.String.positive() is 
applicable for argument types: () values: []

While this script works fine: 尽管此脚本可以正常工作:

def a = new String(
  "test"
  + "test"
  + "test"
)

Why? 为什么?


解决方案:

参考: https://stackoom.com/en/question/LJUD
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章