INTRODUCTION
Java is an object oriented programming language. James Gosling invented Java in the year 1991 from Sun Micro systems. The main aim of Java is to write a program once. So that it can run on many operating systems as it is platform independent. In 1995 the first version of Java (Java 1.0) came into existence. Oak is the name given earlier, as Oak was unsuccessful. It was then renamed as Java. The version of Java that is currently available is Java 1.8 also known as Java 8.
Java is a programming language and a platform. Java is high level and object oriented programming language. Any hardware or software environment in which a program runs is platform. Since Java has its own run-time environment and API, it is platform. In early days, different electronic devices should have different operating systems. So to run every device on unique software came a unique term Java. It is platform independent. It can operate and execute in any operating system.
Java works on the principle "WORA" which means 'write once run anywhere'. Java Virtual machine plays an important role in this concept. The environment in which Java programs execute is JVM. JVM is an abstract machine. It provides runtime environment in which java byte code can execute. Java users do not access the operating systems. It uses Java Virtual Machine as abstraction. This makes Java programs portable. A Java program can run on all platforms. e.g., Windows or Linux.
Object Oriented Programming is a method to design a program using objects. It simplifies maintenance and development of software by using some concepts. It has concepts like object, class, inheritance, polymorphism, abstraction, and encapsulation.
Object:
Any entity having state and behavior is an object. For example: chair, pen, table, keyboard, bike etc. It can be physical and logical.
Class:
A class is a collection of objects. It is a logical entity.
Inheritance:
If one object acquires properties of parent object, it is polymorphism. It provides code reusability. It is also used to achieve runtime polymorphism.
Polymorphism:
Performing one task in different ways is polymorphism. For example: to draw something e.g. shape or rectangle etc.
We use method overloading and method overriding to achieve polymorphism in Java.
Abstraction:
Hiding internal details and showing functionality is abstraction.
Example:
Phone call, we do not know the internal processing.
In java, we use abstract class and interface to achieve abstraction.
Encapsulation:
Binding (or wrapping) code and data together into a single unit is encapsulation. For example: capsule (wrapped with different medicines).
A java class is the example of encapsulation. Java bean is an encapsulated class because all the data members are private here.
Java is a programming language and a platform. Java is high level and object oriented programming language. Any hardware or software environment in which a program runs is platform. Since Java has its own run-time environment and API, it is platform. In early days, different electronic devices should have different operating systems. So to run every device on unique software came a unique term Java. It is platform independent. It can operate and execute in any operating system.
Java works on the principle "WORA" which means 'write once run anywhere'. Java Virtual machine plays an important role in this concept. The environment in which Java programs execute is JVM. JVM is an abstract machine. It provides runtime environment in which java byte code can execute. Java users do not access the operating systems. It uses Java Virtual Machine as abstraction. This makes Java programs portable. A Java program can run on all platforms. e.g., Windows or Linux.
Object Oriented Programming is a method to design a program using objects. It simplifies maintenance and development of software by using some concepts. It has concepts like object, class, inheritance, polymorphism, abstraction, and encapsulation.
Object:
Any entity having state and behavior is an object. For example: chair, pen, table, keyboard, bike etc. It can be physical and logical.
Class:
A class is a collection of objects. It is a logical entity.
Inheritance:
If one object acquires properties of parent object, it is polymorphism. It provides code reusability. It is also used to achieve runtime polymorphism.
Polymorphism:
Performing one task in different ways is polymorphism. For example: to draw something e.g. shape or rectangle etc.
We use method overloading and method overriding to achieve polymorphism in Java.
Abstraction:
Hiding internal details and showing functionality is abstraction.
Example:
Phone call, we do not know the internal processing.
In java, we use abstract class and interface to achieve abstraction.
Encapsulation:
Binding (or wrapping) code and data together into a single unit is encapsulation. For example: capsule (wrapped with different medicines).
A java class is the example of encapsulation. Java bean is an encapsulated class because all the data members are private here.
Comments
Post a Comment