Java Programing laungage

Core Java Tutorial

Introduction of Core Java

How To Install JDk and Set of Path

Syntax of java Program

Difference between Java and C/C++

Advantage and Disadvantage of Java

What is Java

Why Java is not Pure Object Oriented Language

Java has Following Features/Characteristics

Limitation of Java Language and Java Internet

Common Misconception about Java

Simple Program of Java

Integrated Development Environment in java

Compile and Run Java Program

Applet and Comments in Java

Tokens in Java

Keywords in Java

Identifier and Variables in Java


Data Type in Java

Assignments and Initialization in Java

Operators in Java

Rule of Precedence in Java

Operator on Integer and Separators in Java Programming

Java Control Flow of Statements

If and If-else Selection Statement

Nested If-else and If-else-If Selection Statement

switch case and conditional operator Selection Statement

for and while Loop

do..while and for each Loop

break and labeled break statement

continue and labeled continue statement

return Statement and exit() Method

Escape Sequence for Special Characters and Unicode Code

Constants and Block or Scope

Statement in Java

Conversions between Numeric Types in Java

Import Statement in Java

User Input in Java using Scanner Class

User Input in Java using Console Class

Array in Java

One Dimensional Array

Two Dimensional Array

Two Dimensional Array Program

Command Line Argument in Java

String args Types in Java

Uneven/Jagged array in java

Math Class Function and Constant

Math Class all Function used in a program

Enumerated Types in Java

Object Oriented Programming v/s Procedural Programming

Object Oriented Programming Concepts in Java

Introduction to Class,Object and Method in Java

Class Declaration in Java

Class & Objects in java

Encapsulation in Java

Modifiers/Visibility for a Class or Interrface or member of a Class

Polymorphism in Java

Runtime polymorphism (dynamic binding or method overriding)

Object Oriented Programming v/s Procedural Programming
Previous Home Next

All the programs consist of two elements : process (logic) and data. There can be two different approsaches depending upon wheather our main focus in on processing or data. The procedural programming languages (C, FORTRAN, PASCAL, COBOL etc.) focus on the processing part i.e they give more importance to "What is happining "(process) in the system and less importance to "Who is being affected" (data).

The procedural apporach becomes less and less suitable as the programs become large and complex. The object oriented programming languages were developed to overcome the limitation of the procedural programming. The object-oriented programming language are relatively far less complex as compared to the programs within the procedural languages.

The object oriented programs are organized around the data(i.e objects) and a set of well defined interface(public methods ) to that data. Java is based on object oriented paradigm. Java is almost pure object oriented programming language. We have termed "almost" as java also supports primitive data types due to performance reasons. The c++ is not a pure object oriented language. C++ is an extension to c so it uses an approach, which is a mix of procedural-oriented approach and object-oriented approach.

  1. Object-oriented programming
  2. Object-oriented programming can be seen as an extension of procedural programming in which programs are made up of collection of individual units called objects that have a distinct purpose and function with limited or no dependencies on implementation. For example, a car is like an object; it gets you from point A to point B with no need to know what type of engine the car uses or how the engine works. Object-oriented languages usually provide a means of documenting what an object can and cannot do, like instructions for driving a car.

  3. Procedural Programming
  4. Procedural programming can be defined as a subtype of imperative programming as a programming paradigm based upon the concept of procedure calls, in which statements are structured into procedures (also known as subroutines or functions). Procedure calls are modular and are bound by scope. A procedural program is composed of one or more modules. Each module is composed of one or more subprograms. Modules may consist of procedures, functions, subroutines or methods, depending on the programming language. Procedural programs may possibly have multiple levels or scopes, with subprograms defined inside other subprograms. Each scope can contain names which cannot be seen in outer scopes.

    Basic Difference betweeen Object Oriented Programming v/s Procedural Programming
    1. The object-oriented programs are data centric while the program written in the procedural languages are process centric.
    2. The object oriented programs are organized around data (Objects) so they model the real world objects in a better way.
    3. The degree of reusability and extensibility of the code is very high in case of object-oriented approach as compared to procedural approach. So code size is less.
    4. The object-oriented programs are easier to maintain, as they are relatively less complex and smaller in size.
    5. The object-oriented progrrams are based on the bottom-up design methodology while the procedural programs are based on the top-down design methodology.
    Description Procedure Oriented Programming Object Oriented Programming
    Divided Into program is divided into small parts called functions.program is divided into parts called objects.
    ImportanceImportance is not given to data but to functions as well as sequence of actions to be done.Importance is given to the data rather than procedures or functions because it works as a real world.
    Approachfollows Top Down approach.follows Bottom Up approach.
    Access Specifiersdoes not have any access specifier.access specifiers named Public, Private, Protected, etc
    Data MovingData can move freely from function to function in the system. objects can move and communicate with each other through member functions.
    ExpansionTo add new data and function in Prcedural Oriented Programming is not so easy.Object Oriented Programming provides an easy way to add new data and function.
    Data AccessMost function uses Global data for sharing that can be accessed freely from function to function in the system. data can not move easily from function to function,it can be kept public or private so we can control the access of data.
    Data HidingProcedure Oriented Programming does not have any proper way for hiding data so it is less secure.Object Oriented Programming provides Data Hiding so provides more security.
    OverloadingOverloading is not possible.overloading is possible in the form of Function Overloading and Operator Overloading.
    ExamplesExample of Procedure Oriented Programming are : C, VB, FORTRAN, Pascal.Example of Object Oriented Programming are : C++, JAVA, VB.NET, C#.NET.
    Previous Home Next