Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. what is property

what is property

Scheduled Pinned Locked Moved C#
csharpquestionlearning
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bala subramanyam M
    wrote on last edited by
    #1

    Good morning! iam a student learning c#. Can any one tell me what is a property and whats the difference between property and method

    (M.BALA SUBRAMANYAM)

    R O 2 Replies Last reply
    0
    • B Bala subramanyam M

      Good morning! iam a student learning c#. Can any one tell me what is a property and whats the difference between property and method

      (M.BALA SUBRAMANYAM)

      R Offline
      R Offline
      rah_sin
      wrote on last edited by
      #2

      I think property is the characteristics of a class which acts as identity of class.where as methods are various ways which class provide to manipulate its properties to provide desired result.

      rahul

      1 Reply Last reply
      0
      • B Bala subramanyam M

        Good morning! iam a student learning c#. Can any one tell me what is a property and whats the difference between property and method

        (M.BALA SUBRAMANYAM)

        O Offline
        O Offline
        originSH
        wrote on last edited by
        #3

        Properties control access to fields within a class: //Field private int number = 0; //Property public int Number { get { return this.number; } set { this.number = value; } } this allows you to control wether a field can be written to or read from and can perform processing if needed. A method contains code: private string SomeMethod(strin input) { string output = input + "123"; return output; }

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups