Hot

Sharly

Features of Object Oriented Programming



·        Encapsulation

Linking of data and methods within  an object is called encapsulation.  By linking data and methods together the data can be  changed only via the methods. Encapsulation allows us to implement information hiding
                        Information hiding has two aspects

                        Hiding data
An object data con not be changed except by using its own fixed methods. This is important because it protects the data inside and object from external influences.

Hiding of Implementation Details
How the  methods perform. Their  jobs  are hidden from the user.

·        Inheritance

Classes can be organized hierarchy. Concept of one class of objects inheriting the data and behavior from another class of objects. This will allow new classes  to be derived  from existing classes.

·        Polymorphism

Polymorphism means that objects  belonged to different classes can respond to the same message in different  ways.

This can be done in 2 ways
           
            Overriding
            Overloading
           
Overriding        - A sub class inherits the methods from the super class and redefines  it by filling  it with its own instructions. This is done by defining a methods in the sub class that has the same name same arguments and same return type as the super  class’s methods.

Overloading      - Single  class can have two or more methods with the  same name but with  different parameters. The difference  may be in the no of parameters, the data types  or both.



·        Multithreading

Java allows the programmer to run several independent  parts of the  same program concurrently. (They appear to be running  at the same time)
Ex: Scrolling while on animation is happening
More useful in graphical user interface

Java Development Kit – JDK
JDK is a set of command line tools that can be  use to create java programs

Note:          Java is  Case-Sensitive language
Java is a small software. It will not provide a particular IDE  like in VB, Pascal, C

No comments:

Post a Comment