Skip to main content

Introduction to Object Oriented Programming ( OOP )

Object-Oriented Programming


Object Oriented programming is a programing model that is based upon data and object.

Classes 

Classes are the blueprint of objects. Now you will think about what actually blueprints are. Blueprints are actually a design or plan to build something. Let's take an example like the map is detail plan of house classes are detail plan in Object-Oriented programming. let's give you an example of a class on java so that you can unferstand.

public class Car {
    
    int horsePower;
    String name;
    String color;
    String Company;
}

public class Sample {

    public static void main(String[] args) {
        Car car;
        Car mehran;
       
    }
}

Class name always start with capital letters . It is a good practice to name classes .  We will later learn how this is good. So in the above class Car is the name of the class and horsePower , name and color are properties of class, Which we can have any of any car.  If you see the main of your program you can see that a variable of type car is created with name car and only way we can differentiate between type and variable name here is that type is starting with capital letter so now you got why we start class name with capital letter .  In the above code Car is the type which we created and car, mehran are it's objects. Objects are what objects are those instance which we created using blueprint ( class) and we create n number of instances from our classes. So know we will learn about access modifier and member functions in upcoming tutorials. 

Comments

Popular posts from this blog

Steps to remove google accounts from Computer

Open Google . You will see a round shaped picture of google account picture in top right corner as marked in below picture Click on it. Click on sign out of all accounts Click on Sign In at the top right corner as shown in picture below. Click on it. You will see following screen. Select your desired account from it and sign in . Reopen your form by clicking link provided to you, It will be open now.

Steps of splitting pdf files

Goto https://www.ilovepdf.com/split_pdf Click on Select PDF File. Upload your pdf file here. Select Extract Pages from right menu. Click on Split pdf button and wait for the procedure. Now Click on Download Split PDF and you will get a zip file in which there will be separate pdf.