Default values are values that are used in case the user does not explicitly supply a value. It is always recommended that you place these default values at last. Placing them at the beginning or in the middle makes it difficult to skip them when invoking the method.
def m(pos: Int = -1, arr: Array[Int]): Unit = {
// ...
}
def m(arr: Array[Int], pos: Int = -1): Unit = {
// ...
}