What  OOP'S ?
what is oops

What OOP'S ?

What is OOPs ?

Oop's stands for object oriented programming language. The main purpose of oops is to deal with real world entity using programming languages.

Any programming language that follow and support features like Classes, Objects, Inheritance, Polymorphism, Encapsulation, Data Binding, Message Passing and Data Abstraction is called Objects Oriented Programming Language.

The Object Oriented Programming gave a new height of programming by giving the unique way of organizing large complex programs. In Oops we organize a program using two way first is around it's Code and second is around Data.

Oops Features

  1. Class
  2. Object
  3. Method
  4. Inheritance
  5. Polymorphism?
  6. Encapsulation?
  7. Abstraction?


1) What is class?

Class is collection of objects and it doesn't take any space on memory, class is also called blueprint | logical entity.

Syntax :

class class_name
{
 
  ---          // Data
  ---          // Methods 
    
}        

Example :



class Demo
{

  int a = 10; String b ="Kiran";

  void show()
  {
  
    System.out.print(a+" "+b);
  
  }

}            


2) What is Objects ?

Objects is instance of class, that executes the class. Once object is created, it take up space like other variable in memory.

Syntax :



class-name obj-name = new class-name()        

Example :



class Demo             // Class

{
? ? int a=10;
? ? String = "kiran";


? ? void show() ? ? ?  // Method

? ? {
? ? ? ? System.out.print(a+" "+b);
? ? }

}

class Test              // new class

{
? ? public static void main(String[] args)

? ? {
? ? ? ? Demo kiran = new Demo(); ? ?// object
? ? ? ? kiran.show();
? ? }

}        


3) What is Method ?

Method is a Group / Block of code, which take input from the user. Method runs only when it called.



> Predefind - Method     

  pritn();
  sqrt();
   
> Userdefind - Method 
 
  add();
  display();        

Example :


void display()

{
  
   --- 

}        


4) What is Inheritance ?

When a class derives from another class is called Inheritance. Inheritance is a feature or a process in which, new classes are created from the existing classes. The new class created is called “derived class” or “child class” and the existing class is known as the “base class” or “parent class”.

Once class depends on another class. Reusability - Many time used code.

An inherited class is defined by using the?extends?keyword.

Inheritance
What is Inheritance

Example :



class A

{

   --- 

}

class B extends class A

{

   ---

}        


5) What is Polymorphism ?

The word polymorphism means having many forms.

Real-life Illustration:?Polymorphism

A person at the same time can have different characteristics. Like a man at the same time is a father, a husband, an employee. So the same person possesses different behavior in different situations. This is called polymorphism.?

polymorphism
what is polymorphism

Example :



man(father);

man(husband);

man(employee);        


6) What is Encapsulation ?

It is used to wrapping data and information under a into single unit is called encapsulation.

encapsulation
what is encapsulation


7) What is Abstraction ?

Abstraction means displaying only essential information and hiding the details. Data abstraction refers to providing only essential information about the data to the outside world, hiding the background details or implementation.

Example :

Website - only (UI) Front End part visible from the user and all backend part hide from the user.

Abstraction
what is abstraction

I hope you understood what is oops ? If you like this article Follow me for such interesting topics and you also learn with me...! #oops #oopsconcepts

要查看或添加评论,请登录

Kiran Borge的更多文章

  • Instagram 'Edits' App Transforming the Way We Create Videos

    Instagram 'Edits' App Transforming the Way We Create Videos

    Hey everyone, Have you ever struggled with editing videos for Instagram? Maybe you've tried using multiple apps…

  • What is Open AI's Sora?

    What is Open AI's Sora?

    OpenAI has just revealed its new and amazing technology called Sora. This is a super cool AI model that can turn text…

  • C Program Test

    C Program Test

    1) What will be the output of the following C code? #include void main() // Main is called twice { ? ? static int…

  • Why Learn Java?

    Why Learn Java?

    Features of #Java 1) Simple and easy to learn It is very easy to learn java language. It 's syntax also very easy.

    1 条评论
  • DSA (Data Structures And Algorithms) Roadmap

    DSA (Data Structures And Algorithms) Roadmap

    Data Structures and Algorithms are at the base of almost every application we code, every project we create. Interviews…

社区洞察

其他会员也浏览了