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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:25:22+00:00 2026-06-15T08:25:22+00:00

What is the difference between the 2 methods below ? They both return exactly

  • 0

What is the difference between the 2 methods below ? They both return exactly the same (as far as I know) so i’m wondering why one would rather use the one over the other ?

Is there a specific case in which one of the 2 methods below would be preferable ?
Or are there any situations in which it would be better to use func<> over a normal method ?

 private static int addThings(int x, int y)
 {
  return x*y;
 }

 private static Func<int,int,int> addMoreThings = (x,y) =>
 {
  return x*y;
 };
  • 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-15T08:25:23+00:00Added an answer on June 15, 2026 at 8:25 am

    Func is a delegate – (what C++ programmers would call a strongly typed function pointer).

    The Func<int,int,int> means a delegate for functions that take two integers and return an integer – any such function.

    In the case of addThings, the calculation is done immediately and the result returned.

    In the case of addMoreThings, the function is returned. It can be later invoked.

    It is difficult to recommend one over the other without more context – having the delegate version allows you to be lazy – to use the strategy pattern, for example by assigning the strategy to a delegate.

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

Sidebar

Related Questions

Is there any difference between the 2 methods below for calculating c ... specifically
I am trying to understand the difference between 2 methods that have the same
What is the difference between $c->uri_for and $c->uri_for_action methods of Catalyst. Which one to
I want to know the main difference between .live() vs. .bind() methods in jQuery.
What is the difference between the signatures of the two methods below? public static
In PHP, What is the difference between declaring methods inside class like public function
What's the difference between a class method and an instance method? Are instance methods
I am trying to get a difference between the type casting methods. eg. Method
What's the difference in Java between a utility class (a class with static methods)
What is the difference between a method decorated with @staticmethod and one decorated with

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.