Explain vararg arguments

0 votes
Can anyone tell what vararg arguments in Scala?
Jul 24, 2019 in Apache Spark by amrita
89 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, 2019 by Gitika
• 65,870 points

Related Questions In Apache Spark

+1 vote
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,480 points
1,135 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,200 points
7,978 views
0 votes
1 answer

Scala pass input data as arguments

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

answered Jun 19, 2019 in Apache Spark by Lisa
532 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, 2019 in Apache Spark by Gitika
• 65,870 points
85 views
+1 vote
2 answers
+1 vote
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
• 11,380 points
6,820 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
• 11,380 points
1,092 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
47,980 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, 2019 in Apache Spark by Gitika
• 65,870 points
124 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, 2019 in Apache Spark by Gitika
• 65,870 points
521 views