Welcome to WebmasterServe!

FREE TO JOIN! Join us now to engage in informative and friendly discussions about Webmastering, SEO, SEM, Internet Marketing, Programming, Graphic Design, Online Jobs and more. What are you waiting for? Ready to join our friendly community? It takes just one minute to register.

Dismiss Notice

Join WebmasterServe Forums 
Join the discussion! Have a better idea or an opinion? It takes just one minute to register Click Here to Join

Tutorial A Tutorial To Basics Of .net Programming For Beginners

Discussion in '.NET Programming' started by Swati Mishra, Dec 31, 2015.

  1. Swati Mishra

    Yellow Belt

    Joined:
    Dec 28, 2015
    Messages:
    644
    Ratings:
    +105 / -0
    The industry is now widely use two most popular programming languages. One is Java and the other is .Net. .Net is an easy programming language and widely used in banking, private and government sectors. The vivid use in almost areas gradually gives it a comprehensive strength as a programming language.

    I’m here to explain you the basics of .Net programming language that you need to be strong before you go for hard coding. I am writing this on my own, so, I may not be a perfect but I will try to cover most of the areas a beginner should learn.

    Basically, both the popular languages Java and .Net works in the environment of the OOPS concept. Let’s understand it first.


    What is an object?

    Object is anything and everything that has a real world existence. In other words, something that has state, behaves or display or having a unique identity. Simply, it assigns value of the attributes.

    E.g. a payphone need should need a coin every time you want to place a call. That shows its behavior to accept a coin and place the call.


    What is a class?
    Our own world has different types of object. One object is dissimilar to other in a way or two. These collections of object with multiple properties can be classified in different paths. This classification could be known as a class. This is putting up similar things together in a way that could achieve its goal.

    E.g. Bird could be the class for the similar objects where the objects could be known as peacock, crow and sparrow, etc,


    Let’s understand with a simplest programming!

    Class car
    {
    Public:
    Void hunk ()
    {
    …..
    …..
    }
    };


    What is an Abstraction?

    Abstraction can be known as characteristic of n object that makes it different from other objects in a way that creates a wall for the viewer to give it a perfect look.

    In other words, abstraction is a process to hide some real data from the outside the world in a way that makes it look crispier and give a perfect look.
    [​IMG]

    E.g. A bike designed is simple yet stunning what it is made up of a real world people should not know.

    Class car
    {
    Public:
    Char color [21];
    };
    int main ()
    Car ford;
    ….
    …..
    }


    What is an Encapsulation?


    Encapsulation is very similar to the concept of abstraction. Encapsulation is a process to hide the essential characteristic of a data from outside world that they should not know and the characteristic has nothing to do with the change to the outside world in any manner.

    E.g. we just ride a car but we never want to know what inside it. However, there is motor, machines and other elements that make it drive on the road but we need not to know.

    [​IMG]



    What is polymorphism?

    Let’s understand by an example. You have ordered a product from Amazon.com. You either will do it yourself or calls your personal assistant to do this on behalf of you.

    Now, the message has been sent to Amazon.com to be sold for the specific product to deliver to specific address. There has been a multiple message process is done in between you and the delivery boy who is going to delivers the time.


    Thus, the message send by receiver and between the receivers important concept works that is hidden. This concept is called as polymorphism. It is combinations of two words, “Poly and “Morphos”, which means many forms.


    In main programming there are two sets of polymorphism could be seen. Static polymorphism and the dynamic polymorphism and both the set has existing entity so called physical form.

    This can be understood as a female could be wife, mother, and daughter and so on.
    Let’s see an example with the simplest coding.

    Class overload
    {
    Public:
    int max (int, int);
    float max (float, float);
    };
    int overload: :max (int num1, int num2)
    {
    ……
    ……
    ……
    }
    Float overload: :max (float num1, float num2)
    {
    …….
    …….
    …….
    }
    int main ()
    Overload o1;
    }
    [​IMG]

    What is inheritance?

    This is very simple methodology just like the real world does. We all have inherited some qualities from our parents, grandparents, etc,

    Our son/daughter will have our quality inherited in same manner and so go forth.
    So, passing of the quality from one to another is called inheritance. An inheritance is the quality, relationship transfer from one to another in a way or two. This could be a perfect inheritance and could be a lesser depends upon situation.

    Let’s understand by an example!

    There are mammals.
    A dog, Cat and humans will be in this class.

    Differentiating from here a cat class will have its own inherits classes.
    A lion, tiger, leopards, etc,




    [​IMG]

    This can be understood with the help of simple coding. A derived class inherits its base class.


    Class <base_class>
    {
    …..
    …..
    };

    Class <derived_class> : <access specifier> <base_class>

    Please shoot your question if i forgot something and i will be replying to you at earliest.
    Thanks!
     
    • Informative Informative x 2
    • List
  2. skylimit

    Yellow Belt

    Joined:
    Dec 21, 2015
    Messages:
    219
    Ratings:
    +46 / -0
    A very detailed and basic guide.
    Newbie can start with these basic concepts if they are stepping into Programming language.
    Good luck!
     
  3. Oldwriter

    Yellow Belt

    Joined:
    Dec 10, 2015
    Messages:
    64
    Ratings:
    +28 / -0
    Hello dear @Swati Mishra@Swati Mishra

    I'd like to comment something hoping it can be helpful to further the understanding of .NET and Java.

    While the Java Virtual Machine (JVM) has a programming language named Java as its flagship language, the .NET Common Language Runtime (CLR) doesn't have a programming language named “.NET”; it's flagship language is C#.

    There are other languages targeting the JVM, as well as languages targeting the CLR too, not all necessarily adopting the Object Oriented Programming paradigm; there's variety which is good.

    Also, please feel free to illustrate a bit more on the code examples you provided. They look based on C++; since this is the .NET section I think a bit of C# would suit the learning better.

    My 2 cents: a class for car in C# could be:

    Code:
    Select All
    /// <summary> /// The WebMasterServe Car. /// </summary> namespace WebMasterServe { // Directives using System; using System.Drawing; /// <summary> /// Car class. /// </summary> public class Car { /// <summary> /// The make. /// </summary> private string make; /// <summary> /// The model. /// </summary> private string model; /// <summary> /// The color. /// </summary> private Color color; /// <summary> /// Initializes a new instance of the "WebMasterServe.Car" class. /// </summary> /// <param name="make">The make argument.</param> /// <param name="model">The model argument.</param> /// <param name="color">The color argument.</param> public Car(string make, string model, Color color) { // Set the make this.make = make; // Set the model this.model = model; // Set the color this.color = color; } /// <summary> /// Gets or sets the make. /// </summary> /// <value>The make.</value> public string Make { get { return this.make; } set { this.make = value; } } /// <summary> /// Gets or sets the model. /// </summary> /// <value>The model.</value> public string Model { get { return this.model; } set { this.model = value; } } /// <summary> /// Gets or sets the color. /// </summary> /// <value>The color.</value> public Color Color { get { return this.color; } set { this.color = value; } } /// <summary> /// Honk this car. /// </summary> public void Honk() { // Make a sound Console.Beep(); } } }
    This Car.cs class follows the advice: “Avoid declaring variables as public. Use properties and methods to access data values stored in an object”. Very good advice indeed.
     
    #3 Oldwriter, Jan 15, 2016 at 9:03 PM
    Last edited: Jan 16, 2016
  4. Swati Mishra

    Yellow Belt

    Joined:
    Dec 28, 2015
    Messages:
    644
    Ratings:
    +105 / -0
    @Oldwriter@Oldwriter
    Thanks dear. You have put some great details with an example. I really appreciate this for your detailed information that made my thread more valuable.
    Instead, Yes, i know it is more calling C#, but most people called it off .NET, so i use it for a common knowing.
     
  5. Manish Mishra

    Yellow Belt

    Joined:
    Dec 22, 2015
    Messages:
    1,025
    Ratings:
    +159 / -0
    .Net programming gives me the feeling of the decades back when i used to develop programs in visual basic. It has same or even more strong features like GUI based programming concept. However, it is completely different to program in Java & C.
     

Share This Page