Object-oriented programming:
- This is the core feature of java.
- This is to manage the increase in the complexity.
- It provides a very sophisticated and well defined interface for the data.
- It is also known as data controlling access code.
- Another important feature of java being object oriented is abstraction.
- Complexity can be managed using abstraction.
The three OOP principles:
- Encapsulation- Its agenda is to manipulate the data and keep the data isolated and safe from the external interference and misuse. The encapsulation is done by the use of the protective wrapper. This prevents the external sources from accessing the data or the code.
- Inheritance- In this the object would acquire the property of other object present. Itjust follows the concept of the hierarchical classification. This consists of classes, sub classes. Inheritance also is linked or interacts with encapsulation as well.
- Polymorphism- It is means many ways to carry out the method but from one input.
Byte code
This is highly optimized by set of instructions designed which is designed to be executed by Java virtual machine that is JVM.
This is highly optimized by set of instructions designed which is designed to be executed by Java virtual machine that is JVM.
JVM
- It was designed as an interpreter for the byte code.
- Another feature of java program is that it is simple.
- This enables the professionals to learn.
- Work in a very effective manner but it is also very easy to understand.
Robust
The ability that includes creating a robust program that can be a multiplatform program
are given a very high priority in design of Java.
are given a very high priority in design of Java.
Multithreading
The real world requirements are met by java which helps to achieve the requirement of
creating interactive and networked programs.
creating interactive and networked programs.
High performance
- The advantage of being a multi platform functioning program helps to find the cross platform solution.
- It provides benefits of being an platform independent code with the help of java run time system.
Distributed
- This is because it is been designed for the internet which has a distributed environment because of the handling of TCP/IP protocols.
- This allows the program to find out methods across a network.
- URL is used in this to access a file on internet.
- This property supports RMI (Remote Method Invocation).
Dynamic
- This is the action that is taken during the run-time such as to resolve, verify and add objects.
- It provides us the function which will allow us to link code dynamically that will be safe.
Simple program
/* Call this file “Example.java” */
Class Example {
Public static void main (string args []) {
System.out.println (“this is a simple java program.”);
}
}
Class Example {
Public static void main (string args []) {
System.out.println (“this is a simple java program.”);
}
}
Command line argument to pass the class name is
C :\> java Example
Simple output of the above program
this is a simple java program.
Calling of the file in java cmd
Calling of the file: “Example.java”.