Structured Programming Language vs Object Oriented Programming Language By Sana Mateen
• C is called a structured programming lang uage because to solve a large problem, • C programming language divides the problem into smaller modules called functions or procedures each of which handles a particular responsibility. • The program which solves the entire problem is a collection of such functions. • structured programming can save time and energy when writing small and simple programs (Though Simple program is quite relative to the writer) that would essentially hold into one page. • Object-Oriented Programming (OOP) is a programming language model organized around objects rather than “actions”. • The leading languages based on OOP are C++, Java, Python, C#, Visual Basic etc… • The first step in OOP is to identify all the objects the programmer wants to manipulate and how they relate to each other. • Once an object has been identified, the role of the programmer is to generalize it as a class of objects and define the kind of data that it contains and list of procedures that manipulate it.
OOP Basics • Object:In real world could be a desk,tv,bicycle etc. • It share two characteristics state and behavior. • An object stores its state in fields called variables and its behavior through methods. • Methods operate on an object internal state and serve as the primary mechanism for object to object communication.
Encapsulation • Encapsulation in java is a process of wrapping code and data together into a single unit, for example capsule i.e. mixed of several medicines. • It is a technique of making the fields in a class private and providing access to fields via public methods
Polymorphism • It is the concept of object oriented programming.The ability of different objects to respond, each in its own way, to identical messages is called polymorphism. • When one task is performed by different ways i.e. known as polymorphism. • poly mean many morph mean form.
Inheritance • Inheritance in java is a mechanism in which one object acquires all the properties and behaviors of parent object. • The idea behind inheritance in java is that you can create new classes that are built upon existing classes. • When you inherit from an existing class, you can reuse methods and fields of parent class, and you can add new methods and fields also. • Inheritance represents the IS-A relationship, also known as parent- child relationship.
Program • An organized list of instructions that, when executed, causes the computer to behave in a predetermined manner. Without programs, computers are useless. • A program is like a recipe. It contains a list of ingredients (called variables) and a list of directions (called statements) that tell the computer what to do with the variables. The variables can represent numeric data, text, or graphical images. • There are many programming languages -- C, C++, Pascal, BASIC, FORTRAN, COBOL, and LISP are just a few. These are all high-level languages. One can also write programs in low-level languages called assembly languages, although this is more difficult. • Low-level languages are closer to the language used by a computer, while high-level languages are closer to human languages. • Eventually, every program must be translated into a machine language that the computer can understand. This translation is performed by compilers, interpreters, and assemblers. • When you buy software, you normally buy an executable version of a program. This means that the program is already in machine language -- it has already been compiled and assembled and is ready to execute.
L 3.4 Java Class Hierarchy  In Java, class “Object” is the base class to all other classes  If we do not explicitly say extends in a new class definition, it implicitly extends Object  The tree of classes that extend from Object and all of its subclasses are is called the class hierarchy  All classes eventually lead back up to Object  This will enable consistent access of objects of different classes.
Abstraction is the concept of exposing only the required essential characteristics and behavior with respect to a context. Hiding of data is known as data abstraction. In object oriented programming language this is implemented automatically while writing the code in the form of class and object. Real Life Example of Abstraction in Java Abstraction shows only important things to the user and hides the internal details, for example, when we ride a bike, we only know about how to ride bikes but can not know about how it work? And also we do not know the internal functionality of a bike.

java introduction features and propertie

  • 1.
    Structured Programming Language vs ObjectOriented Programming Language By Sana Mateen
  • 2.
    • C is calleda structured programming lang uage because to solve a large problem, • C programming language divides the problem into smaller modules called functions or procedures each of which handles a particular responsibility. • The program which solves the entire problem is a collection of such functions. • structured programming can save time and energy when writing small and simple programs (Though Simple program is quite relative to the writer) that would essentially hold into one page. • Object-Oriented Programming (OOP) is a programming language model organized around objects rather than “actions”. • The leading languages based on OOP are C++, Java, Python, C#, Visual Basic etc… • The first step in OOP is to identify all the objects the programmer wants to manipulate and how they relate to each other. • Once an object has been identified, the role of the programmer is to generalize it as a class of objects and define the kind of data that it contains and list of procedures that manipulate it.
  • 3.
    OOP Basics • Object:Inreal world could be a desk,tv,bicycle etc. • It share two characteristics state and behavior. • An object stores its state in fields called variables and its behavior through methods. • Methods operate on an object internal state and serve as the primary mechanism for object to object communication.
  • 7.
    Encapsulation • Encapsulation injava is a process of wrapping code and data together into a single unit, for example capsule i.e. mixed of several medicines. • It is a technique of making the fields in a class private and providing access to fields via public methods
  • 8.
    Polymorphism • It isthe concept of object oriented programming.The ability of different objects to respond, each in its own way, to identical messages is called polymorphism. • When one task is performed by different ways i.e. known as polymorphism. • poly mean many morph mean form.
  • 9.
    Inheritance • Inheritance injava is a mechanism in which one object acquires all the properties and behaviors of parent object. • The idea behind inheritance in java is that you can create new classes that are built upon existing classes. • When you inherit from an existing class, you can reuse methods and fields of parent class, and you can add new methods and fields also. • Inheritance represents the IS-A relationship, also known as parent- child relationship.
  • 10.
    Program • An organizedlist of instructions that, when executed, causes the computer to behave in a predetermined manner. Without programs, computers are useless. • A program is like a recipe. It contains a list of ingredients (called variables) and a list of directions (called statements) that tell the computer what to do with the variables. The variables can represent numeric data, text, or graphical images. • There are many programming languages -- C, C++, Pascal, BASIC, FORTRAN, COBOL, and LISP are just a few. These are all high-level languages. One can also write programs in low-level languages called assembly languages, although this is more difficult. • Low-level languages are closer to the language used by a computer, while high-level languages are closer to human languages. • Eventually, every program must be translated into a machine language that the computer can understand. This translation is performed by compilers, interpreters, and assemblers. • When you buy software, you normally buy an executable version of a program. This means that the program is already in machine language -- it has already been compiled and assembled and is ready to execute.
  • 12.
    L 3.4 Java ClassHierarchy  In Java, class “Object” is the base class to all other classes  If we do not explicitly say extends in a new class definition, it implicitly extends Object  The tree of classes that extend from Object and all of its subclasses are is called the class hierarchy  All classes eventually lead back up to Object  This will enable consistent access of objects of different classes.
  • 14.
    Abstraction is theconcept of exposing only the required essential characteristics and behavior with respect to a context. Hiding of data is known as data abstraction. In object oriented programming language this is implemented automatically while writing the code in the form of class and object. Real Life Example of Abstraction in Java Abstraction shows only important things to the user and hides the internal details, for example, when we ride a bike, we only know about how to ride bikes but can not know about how it work? And also we do not know the internal functionality of a bike.