Scala 的匯入陳述式跟 Java 非常像,但更為強大。如第一行,同一個 package 下的多個類別可以用大括號括起來一起導入。另外一個差別是,當要匯入套件或類別下所有名稱時,用下標 (_) 而不是星號 (*)。這是因為星號在 Scala 是一個合法的識別符號 (如函式名稱)。
Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with content, and download exclusive resources. This article dives into the happens-before ...