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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:32:26+00:00 2026-05-13T01:32:26+00:00

Does the automatic property of C# 3.0 completely replace the filed? I mean,I can

  • 0

Does the automatic property of C# 3.0 completely replace the filed?

I mean,I can directly use the property instead of filed as property serves as private backing field.(sorry,I understand like that only).

int a;

public int A
{
  get;set;
 }
  • 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-13T01:32:27+00:00Added an answer on May 13, 2026 at 1:32 am

    When you access the property from code – whether inside or outside the class – it is always accessed as a property. In most cases, this is unimportant – but it does mean that you can’t pass it by reference, which you would be able to do if it were a field.

    The only piece of code which accesses the backing field directly (reflection aside) is the property itself.

    It is a property, pure and simple. It isn’t available as a field – it’s available as a property. The C# compiler doesn’t replace accesses to it with field accesses. Accesses to it are always property accesses. It may well be inlined by the JIT compiler of course, but that’s nothing special. As far as the CLR is concerned it’s just a normal property (which happens to have the [CompilerGenerated] attribute applied to it).

    But to answer your original question – yes, the automatic property means you don’t need to declare the backing field yourself. Effectively, this:

    public int Foo { get; set; }
    

    is translated into

    private int <>Foo; // Or some other unspeakable name
    public int Foo
    {
        get { return <>Foo; }
        set { <>Foo = value; }
    }
    

    You cannot access the generated field directly in C# code, as it has an unspeakable name. You’ll see it’s present if you examine the type with reflection though – the CLR doesn’t distinguish between an automatically implemented property and a “normal” one.

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

Sidebar

Related Questions

Possible Duplicate: Can I create an automatic property (no private member) with get and
What does it mean if a task is declared with the automatic keyword in
JavaScript does funky automatic conversions with objects: var o = {toString: function() {return 40;
This might be a silly question but does ARC (automatic reference counting) interact with
Does MySQL come with a built-in automatic failover? Or, are there load-balancers out there
How does one suppress the automatic initialization and destruction of a type? While it
Does anyone knows, it is possible to add a automatic photo to FB timeline
I really like the idea of automatic binding generation like SWIG does. But it
The version of Subclipse (1.2.4) currently available through Aptana's automatic Plugins Manager does not
I want to know that how does automatic migrations work internally in Entity Framework

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.