SCALA Programming, For Beginners, Learn Coding Fast! by Yao Ray

SCALA Programming, For Beginners, Learn Coding Fast! by Yao Ray

Author:Yao, Ray [Yao, Ray]
Language: eng
Format: epub
Publisher: Tutorial eBook & Book, A Quick Start Guide.
Published: 2020-08-04T16:00:00+00:00


Befor using concat(), you need to import Array. _ tool.

Example 6.4

import Array._ // import array tools for concat()

object Merge000 {

def main(args: Array[String]) {

var array1 = Array(0. 1, 0. 2, 0. 3)

var array2 = Array(0. 4, 0. 5, 0. 6)

var array3 = concat( array1, array2) // connect two arrays

for ( elements <- array3 ) {

println( elements )

}

}

}

Output:

0. 1

0. 2

0. 3

0. 4

0. 5

0. 6

Explanation:

Before using concat(), you need to import Array. _ tool.

“concat( array1, array2)” connects two arrays



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.