Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CON-2553-Markdown-Sort-Array-exercise #2526

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions subjects/java/checkpoints/sort-array/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## SortArray

### Instructions

In a file named `SortArray.java` write a function `sort` that returns the given array, specified in the parameters, sorted in ascending order.

### Expected Functions

```java
public class SortArray {
public static Integer[] sort(Integer[] args) {
// your code here
}
}
```

### Usage

Here is a possible `ExerciseRunner.java` to test your function :

```java
import java.io.*;
import java.util.Arrays;

public class ExerciseRunner {
public static void main(String[] args) throws IOException {
System.out.println(Arrays.toString(SortArray.sort(new Integer[]{4, 2, 1, 3})));
}
}
```

and its output :

```shell
$ javac *.java -d build
$ java -cp build ExerciseRunner
[1, 2, 3, 4]
$
```
Loading