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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:32:58+00:00 2026-06-13T16:32:58+00:00

From what I can tell, properties are used to provide accessor method-esque functionality; however,

  • 0

From what I can tell, properties are used to provide accessor method-esque functionality; however, they do so at the cost of normal method inheritance behavior. Are there any advantages to using properties versus conventional setter/getter methods? What are the pros/cons of properties and accessor methods?

  • 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-13T16:32:59+00:00Added an answer on June 13, 2026 at 4:32 pm

    I think you might be confused. In your examples, the above methods should be accessible. For example, given this set of types, the following should work:

    public class Base
    {
        public virtual int Datum { get; set; }
    }
    
    public class Derived : Base
    {
        public override int Datum
        {
            get { return 12; }
            // set method remains as normal, with just the get overriden
        }
    
        public void SetDatumMethod(int newValue)
        {
            Datum = newValue; // Datum as a property is still accessible
        }
    }
    

    The derived class still inherits the property. Properties really are just syntactic sugar in C# (mostly), as the compiler is generating set_Datum(int x) and get_Datum() methods behind the scenes for you. The property get/set methods can still be overridden individually as shown above.

    The advantage of using properties is that they have additional semantic meaning; they “contain” or “represent” data in some fashion, not a method for generating the data.

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

Sidebar

Related Questions

Is there any way I can tell Jackson to ignore properties from parent class
so from what i can tell, you have to specify artifacts and working directory
NSDecimalNumber is a subclass of NSNumber, and from what I can tell, it implements
i have invoked blackberry calender from my application can anyone tell me how to
From the question you can probably tell that I don't know much about code!
Can anybody tell how to retrieve data from database like that of Facebook's notification
Can anyone tell me how I can download a picture from a URL and
can anyone tell how to access MS SQL Server from objective c programatically
How can I tell if return() was called from within the included file. The
Can someone tell me how to catch parameters passed from URI in JSF's managed

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.