Importance Of Object Oriented Programming

1230 Words5 Pages
Introduction about Object Oriented Programming Concept Object oriented programming is a programming method that combines ; data instructions for processing that data Into a self-sufficient ‘object’ that can be used within a program or in other programs. According to the above informations we can say that object oriented programming refers to a programming methodology based on objects, instead of just functions and procedures. There are lot of programming languages known as object oriented languages. If we mention some object oriented languages which are mostly used languages – java, C, C++, C#, php. Those are the few object oriented languages. Actually most modern programming languages are object oriented languages. I think because of…show more content…
Java has become popular , because it uses a virtual machine. The virtual machine is important , because it allows code to be run on multiple platforms without having to be changed. Many developers now understand the importance of Object Oriented Pragramming. Why do we need Object Oriented Programming ? Actually in the above informations I told object oriented programming makes easier for programmers to organize software programs and easy to update. When we talk about Object Oriented Programming we usually mention “objects”. Because Object Oriented Programming is based on objects. So we need to know what is an object. In simply we use object is an instance of a class. On the other hand we can say object is a bundle of related variables and functions(methods). So we have to know what is a class. Because the basic unit of Object Oriented Programming is a class. A;so object is an instance of a class. Simply we can say class is a template, blueprint or contract that defines what an objects data fields and methods will be. We can create many instances of a class. That mean we can create many objects of a one class. That is a big…show more content…
Class Vehicle{ void wheels(int wheelcount){ System.out.println(“wheelcount”); } void wheels(String wheelname){ System.out.println(“wheelname”); } public static void main(String ar[]){ Vehicle v=new Vehicle(); v.wheels(4); } } Now lets see what is an overriding ; Overriding – we can give a simply meaning for overriding like this ; Derived class is implementing a method of its super class its called overriding. In other way we can give definition like this ; redefining a super class method in a sub class is called method overriding. It has same name methods and also methods parameters list are same. When we override methods, JVM determines the proper methods to call at the programs run time , not at the compile time. That mean give priority to object value(object made from which class), not to object reference type. So this is called “Runtime polymorphism”. Lets see a java code example for Complile time polymorphism.(Overloading) class A{ void m(int i){ System.out.println(“A”); }} class B extends A{ void m(){ System.out.println(“B”); } public static void main(String ar[]){ A a=new B(); a.m(10); } } Output

More about Importance Of Object Oriented Programming

Open Document