Beginners Guide And TIps

Learn Something New Here

  • Home
  • Travel
    • North America
      • USA
    • Europe
    • Asia
  • Technology
    • Programming
      • General
      • Python
      • JavaScript
  • Cooking
    • General
  • Hobby
    • Plants
      • Indoor Plants
      • Succulents
      • Holiday Plants
  • Home
  • Travel
    • North America
      • USA
    • Europe
    • Asia
  • Technology
    • Programming
      • General
      • Python
      • JavaScript
  • Cooking
    • General
  • Hobby
    • Plants
      • Indoor Plants
      • Succulents
      • Holiday Plants

Friday, August 14, 2020

Tutorial on Programming : Objects & Classes

 RandomTandem     August 14, 2020     General Programming, Programming, Technology     No comments   

 



What is an Object in Programming

Objects in real world are any tangible objects, which you can feel through physical sense like touch, sound or smell. In computer programming, an object is a model of real world object with a state and behavior. State refers to a collection of data about the object and behavior represents any action that can be done by the object or on the object. In code, the state of the object is represented using variables and the behaviors are written either as functions or methods. 

Lets take an example of a Bicycle. The state of the bicycle are the color, number of wheels and gears. Behavior on the cycle object would refer to changing gears, applying brakes or pedaling. 

What is a Class in Programming

A class is a template that a developer codes, using which objects can be created.  An object is called as an instance of an class. Taking the example of bicycle above, lets say a family of four has 4 different bicycles. The father has a mountain bike, whereas the mother has a racing bike, their teenager daughter has a BMX and the toddler has a tricycle. In essence each of the bicycle provided as an example is a distinct object but all of them are bicycles which have a set of common behavior and state. So a class,  in layman terms are blueprints for an object. They provide a common structure for a particular object type. 

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Featured Post

50 Simple Things to Improve your Life

How to Improve your life Here is a list of 50 simple things which you can do on a daily basis to improve your life and the others around you...

Popular Posts

  • Epidendrum Orchid: A Complete Guide to Care, Growth, and Maintenance
    The Epidendrum Orchid, a beautiful and diverse genus within the orchid family, captivates plant lovers with its vibrant flowers and hardy na...
  • Calathea Orbifolia: The Ultimate Guide to Care, Growth, and Maintenance
      The Calathea Orbifolia is a stunning houseplant known for its large, round leaves marked by silver and green stripes. Its impressive folia...
  • Nurturing the Spider Plant: A Comprehensive Care Guide
    The Spider Plant, scientifically known as Chlorophytum comosum, is a beloved houseplant renowned for its air-purifying qualities and gracefu...
  • Unraveling the Wonders of Inch Plants: A Comprehensive Care Guide
    The Inch Plant, scientifically known as Tradescantia zebrina, is a captivating and resilient houseplant that has become a favorite among pla...
  • Unveiling the Peace Lily: A Comprehensive Guide to Serenity in Greenery
    The Peace Lily, scientifically known as Spathiphyllum, is a botanical masterpiece that graces homes and offices with its elegance and sereni...

Copyright © Beginners Guide And TIps | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates