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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:32:10+00:00 2026-05-25T11:32:10+00:00

Are parameters evaluated in order when they passed into a method? For Java it’s

  • 0

Are parameters evaluated in order when they passed into a method?

For Java it’s always true, for C it isn’t, but what is the answer for C#?

Sample

string.Format("byte1={0} byte2={1} byte3={2}", 
  getNextByte(), 
  getNextByte(), 
  getNextByte());

int pos=0;
byte[] arr=new byte[] {1,2,3,4,5,6};
byte getNextByte()
{
  return arr[pos++];  
}

This sample works, but is it only luck or a rule?

  • 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-25T11:32:10+00:00Added an answer on May 25, 2026 at 11:32 am

    Yes, expressions passed as arguments to methods are always evaluated from left to right.

    From the C# 4.0 Language Specification:

    7.5.1.2 Run-time evaluation of argument lists

    During the run-time processing of a function member invocation (§7.5.4), the expressions or variable references of an argument list are evaluated in order, from left to right, […]

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

Sidebar

Related Questions

In clojure, keywords evaluate to themselves, e.g.: >>:test :test They don't take any parameters,
Parameters are used to protect you from malicious user input. But if the parameter
Query parameters : http://example.com/apples?order=random&color=blue Matrix parameters : http://example.com/apples;order=random;color=blue When should one use query parameters
I've coded an experimental function which makes passed objects chainable by using high order
In what order are the following parameters tested (in C++)? if (a || b
I need to smooth some simulated data, but occasionally run into problems when the
what parameters should i use to start a console app minimized or hidden? is
Why are 'out' parameters in .NET a bad idea? I was recently asked this,
Many of the parameters for interacting with the Office Object model in VSTO require
Routines can have parameters, that's no news. You can define as many parameters as

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.