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

  • SEARCH
  • Home
  • 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 1069375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:24:52+00:00 2026-05-16T20:24:52+00:00

Something like: public static void Estimate ( params string [ ] names, params int[]

  • 0

Something like:

public static void Estimate ( params string [ ] names, params int[] numbers )
{ }

where you could use it like:

Estimate ( "Eric", "Simpson", "Jon", 1, 2, 3, 4, 5 )
  • 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-16T20:24:52+00:00Added an answer on May 16, 2026 at 8:24 pm

    Tomas and Kirk are right, this would be difficult to resolve and, even more so, it would potentially produce unexpected behavior from the point of the developer using it. For example, take the following class:

    public class Overload<T, U>
    {
        public void SomeMethod(params T[] arrayOfT, params U[] arrayOfU) { }
    }
    

    Allowing multiple parameters using the ‘params’ keyword in a method would make this compile just fine, and would work fine for quite a few cases until someone tried to use the class as Overload<string, string> (or something similar) and then a compilation error would happen. Another difficulty is that a parameter marked with the ‘params’ keyword allows the omission of that parameter when calling the method. For example, the following is also impossible to resolve adequately if the method is called with no parameters or even with several int values.

    void SomeOtherMethod(params string[] arrayOfString, params int[] arrayOfInt);
    void SomeOtherMethod(params int[] arrayOfInt);
    

    Language features are generally added if there is a distinct benefit to them being there. Will they make things easier or just impede progress? This is a clear impediment, and one that can be gotten around by doing like Tomas suggested and using a params object[] parameter. You can also pass individual arrays (i.e. SomeOtherMethod(string[] arrayOfString, int[] arrayOfInt)), if separating by type works better for you.

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

Sidebar

Related Questions

I have extension method that does something like this public static void DoStuff(this ObjectContext
I'm currently doing something like this; import java.util.*; public class TestHashMap { public static
What I am thinking of is something like the this keyword but at a
Assume we have a trivial Java program that consists of just one class: public
I am currently using/experimenting with autofac as my IoC controller. Previously to this I
My application has the following project structure: There is the Business Logic project and
Possible Duplicate: LINQ equivalent of foreach for IEnumerable<T> I'm wondering whether there is a
I want to make my program initialization a bit smarter. I have several classes
In an earlier question (unrelated to Fluent NHibernate- I've switched as a result of
I'm developing an web app using asp.net mvc. I have a List in Cache

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.