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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:37:53+00:00 2026-05-12T09:37:53+00:00

I am currently reading Effective C# and found the following line very confusing: Last,

  • 0

I am currently reading Effective C# and found the following line very confusing:

Last, but certainly not least, you can
use interfaces to create const and
nonconst versions of an interface:

What are and nonconst versions of an interface? And where would we use this?

Supporting code:

public interface IConstNameValuePair
{
  object Name
  {
    get;
  }

  object Value
  {
    get;
  }
}
public interface INameValuePair
{
  object Value
  {
    get;
    set;
  }
}

// Usage:
public class Stuff : IConstNameValuePair, INameValuePair
{
  private string _name;
  private object _value;

  #region IConstNameValuePair Members
  public object Name
  {
    get
    {
      return _name;
    }
  }

  object IConstNameValuePair.Value
  {
    get
    {
      return _value;
    }
  }

  #endregion

  #region INameValuePair Members

  public object Value
  {
    get
    {
      return _value;
    }
    set
    {
     _value = value;
    }
  }
  #endregion
}
  • 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-12T09:37:53+00:00Added an answer on May 12, 2026 at 9:37 am

    It is showing that, through one of those interfaces, you can’t actually modify the value (the ‘set’ property isn’t defined). It’s a little dubious to call this ‘const’, as that is actually a keyword that has special meaning. But that’s what the author means.

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

Sidebar

Related Questions

I'm currently reading Learning Rails 3. I'm working on an example where you can
I am currently reading an WPF tutorial and i don't fully understand the following
I'm currently reading in a text file containing the following lines: 0 24000 97200
I'm currently reading 'Javascript Web Applications' (O'Reilly, Alex MacCaw) and very early on there's
I am currently re-reading Effective Java while working at a shop that makes heavy
I am currently reading Cormen's Introduction to Algorithms and I found something called a
I'm currently reading a java concurrency tutorial in http://tutorials.jenkov.com/java-concurrency/creating-and-starting-threads.html I could not understand what
Currently reading Bloch's Effective Java (2nd Edition) and he makes a point to state,
I'm currently reading Effective Java by Joshua Bloch and Item 17 is 'Design and
While reading Effective Java I came across the suggestion to use enums instead of

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.