Skip to main content

What is Object Oriented Programming.?


Hello Friends
I am Kushal Bhatt.
And I am here with new topic on object oriented concepts on our blog CompuTech.

So let's start our today's topic,

Object oriented concepts are relates to our life
Oops concept are used in real time use .
It is also provide data hiding so data can not accessible by external functions. data abstraction concept that help in improve the security.
In Object Oriented Programming program are divide in no.  of objects.
New data and methods can easily add whenever necessary.
Object oriented programming is follow bottom to up in program design.

There are following concepts are providing by Object Oriented Programming.

1.class
2.Objects
3.Data Abstraction
4.Encapsulation
5.Inheritance
6.Polymorphism.
7.Message Communication
8.Data Binding.


1. Class:-

         Class is a a way to enclose a methods variables in single package or unit known class.
         So we can easily identify the behaviour of any variable and methods.
         We can access this methods and variable by creating Object of class according use require so we can say that class provide blueprint of creating objects..
       All data in class is private that means it is not accessible outside class in java that is called Abstract Data Type.
we will discuss a class declaration and structure in next blog post.

2. Objects:-


     Object is basic run time entities.
     normally Object is represent real life entities.
     We can create any number of Objects of class.
     by using this Object we can access the property of class.
     object can interact without having to know the details of each others data or code.
     there are different way tocreate object in different programming languages.
     this object of class can interact to each other to share a information.


3. Data Abstracțion:-


          Abstracțion is representing the essential features without including background details.that can help to represent Complex process or things in simple way.
          Class is use this concept to defined list of attributes which is hold important information.
          It is provide a security that unauthorized methods can not access data in class.

 Take a example of Abstracțion,

     We are withdraw cash from ATM we only perform certain steps but we not need to install cash in ATM we not need to worries to inform a bank Transactions. It is automatically handled.

    Another example related java is once you write java source code and compile it and generate byte code by JVM but we not need to write a single line in JVM to perform this process we only compile it and generate a class file in seconds or minutes.

     We can achieve a Abstracțion by implement interface or extend abstract class.


4. Encapsulation:-


Encapsulation is a process of bind  or wrap variables and methods in single unit called Encapsulation.

This insulation is used to hide a data or methods from external access.objects and methos of that class can only access.

It is most strictly feature of class.
In every program encapsulation is used by class.

With help of encapsulation we have advantage like reusability data hiding and 
Fast test in unit testing.

So it is provide security and maintaiblity of programs.


5.inheritance:-


Inheritance is mechanism to derive new class from old class is called inheritance or derivation.
Inheritance is  provide concept of Reusablity.
that means we can add new features to existing class without modifing whole program.the new class has features of both classes.

old class called a base class. and derived class called  to new class.
so new class need to defined only new features to it.
so it reduce length of code/

There are following types of Inheritance.

1. Single Inheritance.
2.Multilevel Inheritance.
3. hierarchical Inheritance.
4. hybrid Inheritence.



there are another type is multiple Inheritance but this is not supported by java it is supported by C and C++ .
in java Multiple Inheritance not support because it can make Program more Complex.
but in java there is replaced by Interface.

we will learn about in in deeply in another blog.



6.Polymorphism:-


Polymorphism is Greek word that mean Ability to take more than one form.
This operation provide different behaviors in different situations.
This behaviors are depend upon data used in operations.
It is also known as Overloading.
Overloading has two types 
   1. Compile Time.
   2. Runtime.


Example of polymorphism:-


Consider Operation of addition,
For two numbers operator generate sum.
Ex:-.  2+2=4.
For two strings operator perform concatenation 
Ex:- "Kushal"+" Bhatt"=Kushal Bhatt.

In java,

what is polymorphism in java,oop,Object Oriented progrmming in java,inheritance in java,class in java

Consider above figure,
Game_player is main class that inherits in three sub class 

1.play_football
2.play_cricket
3.play_tennis.

All class are used same method game().
But print different things.

1.play Football
2.play Cricket.
3.play Tennis.

Note:We are not going to use program for this example because we not complete that chapter about java program structures related topic if we complete that the. I'll give internal link for program example for polymorphism.


7.Message Passing:-


Message passing is a process to interaction between objects of class.

Object are communicating with one other by sending and receiving the information.

Application has many objects to each other..

There are different way to message communication 

1.using methods
2.using constructors
3.using objects.
4.using threads.

This all way we are use in practically which we will discuss in different blog post.


8.Data Binding:-


To process of connect to methods to call methods body is calling binding.

There are two way for binding data:-

  1. Compile Time or static or Earlier Binding.
  2. Runtime or Dynamic or Late Binding.

Compile Time Binding. is code which associated with given procedure at the Cimple Time is called Satic Binding or Compile Time Binding or Earlier Binding.
it is better then runtime binding performance wise .
all final,static,private methods is done at Compile Time.

Run time Binding is code that associated with given procedure at the runtime is called Runtime Binding or Dynamic Binding or Late Binding.
 in runtime we can call a overidding method is example of runtime binding.

So this is brief description of object oriented programming hope it helpful to you .please share comment and like this post which is encourage me .
Thank you.
See you to next blog post.
I will also make blog on individual concepts of OOPs .






Comments

Popular posts from this blog

Difference between C and Java ,C++ and Java

Hello Friends I am Kushal Bhatt. And I am welcome you on our blog CompuTech with another topic. Today's topic is Differ ence between C and Java ,C++ and Java. First we discuss Difference bet ween C and Java. 1 . C was develop by Dennie Ritchie at AT&T Bell Labs between 1969 to 1973, On other hand Java was develop by James Gosling at sun Microsystems which first appear in 1995. 2. C is Procedural Ori ented Programming langu age On other hand Java is Object Oriented Programming language . 3. C is Low level langu age On other hand Java is High level lang uage. 4. C is Compi le lang uage On other hand Java is Interpreter Langua ge. 5. C follow Top Bottom approach. on other hand Java follow Bottom Top approach. 6. C contains the Preprocessor Directives header file like #include,#define. On other hand Java not contains any header file. 7 . C support Goto statement, Structure,union but Java not support Goto statement, Stru...

Features of java for beginners

Hello friends I am kushal bhatt And I am welcome you on my another post on java subject in our blog CompuTech. Today We need to discuss the key features provided by java . So lets start our todays topic Java is very high level programming language and its also support oops concepts that make it more better. There are list of features provide by java 1.Simple and Familier 2.Object Oriented. 3.Robust and Secure. 4.Plateform Independent and portable. 5.Compiled and Interpreter. 6.Distributed. 7.Multithreading and Interactive 8.High Perfomance. 9.Dynamic and Extensive. 1. Simple and Familier: -             Java are not use some of features such as Operator overloading,Multiple Inheritence,Goto statement , pointer, Preprocessor Directive and many more features which is helpful to reduce complexity of program. Java is quite similar to C and C++ even though Java syntax similar to C and C++. So it is easy to unde...

Basic Introduction of Java for beginners

Hello Friends I am kushal bhatt and I am welcome you on our very first  blog CompuTech . Friends, you all are already aware about a Java Programming Language like how to write a code how to compile and run it but i am here to discus about . Why Java was invented. Which requirement fulfilled by Java and Nowadays Where actually java is used in a real time . So it is very required for your career to clear basic fundamental of java . So lets start our todays topics☕ First of all we need to clear what is actual java is? Java is a System friendly High level programming language that means java can easily interact with system. Java is a pure Object Oriented Programming language because everything in java must be object or class . History :- Java was Developed by James Gosling at sun microsystems in 1990  and after couple of years it acquire by Oracle corporation till now. Sun microsystem actually want to develop a language that can easily work with e...