Skip to content

Commit

Permalink
Fixed wrong syntax for Java array (#2973)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dieken authored Feb 23, 2024
1 parent ffe5096 commit 862896c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions _overviews/scala3-book/scala-for-java-devs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
4 changes: 2 additions & 2 deletions _zh-cn/overviews/scala3-book/scala-for-java-devs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 862896c

Please sign in to comment.