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 7402237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:41:36+00:00 2026-05-29T04:41:36+00:00

I want to run a bit of Java in Scala console. Here’s what I

  • 0

I want to run a bit of Java in Scala console. Here’s what I get:

scala> String.format("hello %d",3);
<console>:8: error: overloaded method value format with alternatives:
  (java.util.Locale,java.lang.String,<repeated...>[java.lang.Object])java.lang.String <and>
  (java.lang.String,<repeated...>[java.lang.Object])java.lang.String
 cannot be applied to (java.lang.String, Int)
              String.format("hello %d",3);

Why Scala can’t recognize which method to call, if argument set is different, and the ones I provide are quite unambigous?

What is strange, the same message appears also when I try to call function with arguments which don’t match to any of both argument sets, e.g. String.format()

I was using scala 2.9.1

  • 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-05-29T04:41:37+00:00Added an answer on May 29, 2026 at 4:41 am

    Your arguments don’t match the function prototype. You’re calling the function with second argument scala.Int which is not a java.lang.Object.

    Convert it to java.lang.Integer and it will work.

    See also boxing and unboxing in Scala.

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

Sidebar

Related Questions

We have created an application which we want to run in a 64 bit
I want to make existing .NET applications (WinForms and WebForms) run on 64-bit machines,
I want run a script as follows: runner: ssh 'java program &' ssh 'java
I want to run a bit of code if, and only if, a visitor
I want to run this function, or at least the bit that deletes the
I want to run a light java app on a remote server running linux.
I want to run a java program in Linux and change its working directory
I want run all script from the directory . Like , The directory contains
Why this code don't work,when i want run this code vwd 2008 express show
I have written php program and uploaded on server. I want run this program

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.