Scala Int to(end: int, step: int) method with example
The to(end: int, step: int) method is utilized to return a range from the stated integer to the ‘end’, which is given in the arguments list and some step is also specified in the arguments list.
Method Definition: def to(end: Int, step: Int): Inclusive
Return Type: It returns the range.
Range(5, 7, 9)
Range(0, 3, 6, 9)