Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8054209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:05:52+00:00 2026-06-05T08:05:52+00:00

What i know: scala> def fx(s: String *) = s.foreach(println) fx: (s: String*)Unit scala>

  • 0

What i know:

scala> def fx(s: String *) = s.foreach(println)
fx: (s: String*)Unit

scala> val lst = List("1","2","3")
lst: List[java.lang.String] = List(1, 2, 3)

scala> fx(lst:_*)
1
2
3

What i want to know:

  1. How can I implement :_*? by map?
  2. Is there any other way that replace it?
  3. How :_* defined in Scala?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:05:54+00:00Added an answer on June 5, 2026 at 8:05 am

    It is only a syntactic sugar to indicates to the compiler that you already provide a sequence of elements, there is no other “implementation” of it. For more information, you can refer to the Scala Language Specification (§6.6, p. 78)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Scala and don't know Java. I want to create a jar
(Yes I know I can call Java code from Scala; but that is pointless;
trait PublicApi{ def sayHi(from:String,content:String) } I know that it is impossible in java to
In Scala one can write (curried?) functions like this def curriedFunc(arg1: Int) (arg2: String)
Using Scala's command line REPL: def foo(x: Int): Unit = {} def foo(x: String):
See this example: def hello(a:String, b:String) = println(a + : + b) val m1
Can someone please explain the major differences between Scala, Groovy and Clojure. I know
Does anyone know if something like this is possible in Scala: case class Thing(property:String)
What's the difference of the following definition? 1.def debug(msg: => AnyRef) = { println(String.valueOf(msg))
I'm learning Scala and I want to know the best way of expressing this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.