diff --git a/_overviews/scala3-book/scala-for-java-devs.md b/_overviews/scala3-book/scala-for-java-devs.md index d7d921b06..37482bdc4 100644 --- a/_overviews/scala3-book/scala-for-java-devs.md +++ b/_overviews/scala3-book/scala-for-java-devs.md @@ -978,8 +978,8 @@ val a = Array("a", "b") as being backed by this Java `String[]`: -```scala -String[] a = ["a", "b"]; +```java +String[] a = {"a", "b"}; ``` However, a Scala `Array` also has all of the functional methods you expect in a Scala collection, including `map` and `filter`: diff --git a/_zh-cn/overviews/scala3-book/scala-for-java-devs.md b/_zh-cn/overviews/scala3-book/scala-for-java-devs.md index 918c1779a..c8f449fd5 100644 --- a/_zh-cn/overviews/scala3-book/scala-for-java-devs.md +++ b/_zh-cn/overviews/scala3-book/scala-for-java-devs.md @@ -942,8 +942,8 @@ val a = Array("a", "b") 这个追溯到 Java 的 `String[]`: -```scala -String[] a = ["a", "b"]; +```java +String[] a = {"a", "b"}; ``` 但是,Scala `Array` 还具有您期望在 Scala 集合中使用的所有函数方法,包括 `map` 和 `filter`: