Explain vararg arguments.

0 votes
Can anyone tell what vararg arguments in Scala?
Jul 24 in Apache Spark by amrita
25 views

1 answer to this question.

0 votes

Hey,

With varargs, we can pass a variable number of arguments to a method.

scala> def func(arg:String*)=arg.mkString(", ")

func: (arg: String*)String

scala> func("red","green","blue")

The result will be:

res28: String = red, green, blue

answered Jul 24 by Gitika
• 25,340 points

Related Questions In Apache Spark

0 votes
1 answer

Can anyone explain what is RDD in Spark?

RDD is a fundamental data structure of ...READ MORE

answered May 24, 2018 in Apache Spark by Shubham
• 13,300 points
602 views
0 votes
3 answers

Can anyone explain fold() operation in Spark?

Fold in spark Fold is a very powerful ...READ MORE

answered Aug 22, 2018 in Apache Spark by samarth295
• 2,190 points
3,321 views
0 votes
1 answer

Scala pass input data as arguments

Please refer to the below code as ...READ MORE

answered Jun 19 in Apache Spark by Lisa
38 views
0 votes
1 answer

At which point of time Scala will take default arguments?

Hi, If we omit an argument in a ...READ MORE

answered Jul 25 in Apache Spark by Gitika
• 25,340 points
20 views
0 votes
1 answer
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,670 points
2,998 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,670 points
334 views
0 votes
10 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
14,794 views
0 votes
1 answer

How will you explain yield keyword in Scala?

Hi, Yield keyword can be used either before ...READ MORE

answered Jul 5 in Apache Spark by Gitika
• 25,340 points
30 views
0 votes
1 answer

Explain the for loop for printing the Map values in Scala in Apache Spark?

Hey, You can see this following code to ...READ MORE

answered Jul 22 in Apache Spark by Gitika
• 25,340 points
39 views