Introduction to Java
- Keshari Abeysinghe

- Jul 19, 2020
- 2 min read
Java is a popular programming language which created by sun micro systems and later acquired by Oracle.Java is an object-oriented, cross platform, multi-purpose programming language .It is used for mobile applications (specially Android apps),desktop applications,web applications,web servers and application servers,games,database connection and much, much more.
Java is another most popular language in the world .Because,
Java works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc.)
It is easy to learn and simple to use
It is open-source and free
It is secure, fast and powerful
It has a huge community support (tens of millions of developers)
Java is an object oriented language which gives a clear structure to programs and allows code to be reused, lowering development costs
As Java is close to C++ and C#, it makes it easy for programmers to switch to Java or vice versa
Main Features of JAVA
Java is a platform independent language
Compiler(javac) converts source code (.java file) to the byte code(.class file). As mentioned above, JVM executes the bytecode produced by compiler. This byte code can run on any platform such as Windows, Linux, Mac OS etc. Which means a program that is compiled on windows can run on Linux and vice-versa. Each operating system has different JVM, however the output they produce after execution of bytecode is same across all operating systems. That is why we call java as platform independent language.
Java is an Object Oriented language
Object oriented programming is a way of organizing programs as collection of objects, each of which represents an instance of a class.
4 main concepts of Object Oriented programming are:
1.Abstraction
2. Polymorphiss
3.Inheritance
4.Encapsulation
Secure
We don’t have pointers and we cannot access out of bound arrays (you get ArrayIndexOutOfBoundsException if you try to do so) in java. That’s why several security flaws like stack corruption or buffer overflow are impossible to exploit in Java.
Portable
As discussed above, java code that is written on one machine can run on another machine. The platform independent byte code can be carried to any platform for execution that makes java code portable.
Simple
Java is considered as one of simple languages because it does not have complex features like Operator overloading, multiple inheritance, pointers and Explicit memory allocation.
Java is distributed
Using the Java programming language we can create distributed applications. RMI(Remote Method Invocation) and EJB(Enterprise Java Beans) are used for creating distributed applications in java. In simple words: The java programs can be distributed on more than one systems that are connected to each other using internet connection. Objects on one JVM (java virtual machine) can execute procedures on a remote JVM.
Multithreading
Java supports multi-threading. Multi threading is a Java feature that allows concurrent execution of two or more parts of a program for maximum utilization of CPU.
Robust Language
Robust means reliable. Java programming language is developed in a way that puts a lot of emphasis on early checking for possible errors, that’s why java compiler is able to detect errors that are not easy to detect in other programming languages. The main features of java that makes it robust are garbage collection, Exception Handling and memory allocation.




Comments