Java as an Object-Oriented Language. Instructor Jeff Zhuk

  • Link to examples of working with classes and objects in Java code

    Java is an object-oriented programming language developed by Sun Microsystems to solve a number of problems in modern programming practice. It includes built-in networking and multi-media support providing programming for the Internet.

    What is Object-Oriented Programming (OOP) ?

    There are several concepts of OOP and their relations to each other:

    Object-oriented programming encourages code reuse rather than its re-invention;
    Object-oriented programming allows a developer to create software which can be easily
    understood and distributed to others;

    Encapsulation is just a technical name for information hiding.
    Encapsulation means that a user sees only the services available from an object
    but not how those services are implemented.

    When you write a program with object-oriented language it means that you deal with data and methods, that manipulate that data. Class is a collection of data and methods that operate on that data. The data and methods describe the state and behavior of an object.

    Inheritance is an ability of classes to be arranged in a hierarchy. Class can have subclasses and every subclass has a root class. Root class is a class with very general behavior. Subclasses inherit all the methods and variables from their superclasses. Your class becomes a combination of all the features of the classes above it in the hierarchy.
    From this we can see that every subclass carries more information than its parent.
    The farther down we go, the wider class we have.

    Using inheritance we can write code at run-time, selecting an object of one of many subclasses having a common parent.

    Polymorphism is an ability of run-time selection of proper methods for an object based on the class of the object.

    Java comes with extensive set of classes, arranged in packages.

    Back To Object Oriented Programming