Every IT or Computer Science student and working IT professionals might have heard of Java language. Everyone wants to learn java, whether it be for Web development, Android app development, desktop application development, Game development etc. So in this blog will get to know about Java language and it's features.
What is JAVA?
Java is a high-level, object-oriented, open source, robust and secure programming language. Java was initiated by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun Microsystems, Inc in 1991. Java was released in 1995 at Sun Microsystems. The java language was earlier called as "Oak", since Oak was already a registered company it was later renamed as "Java". Later Oracle Corporation purchased Sun Microsystems and now Java is owned and maintained by Oracle.
The syntax of Java was derived from C language and many of Java`s object-oriented features were influenced by C++. Java was created to solve the fundamental problems that the preceding languages could not solve.
Around 3 billion devices use java. It implements "WORA", which means- "Write Once Run Anywhere". The java program is converted into bytecode and this bytecode can be run on any computer that contains a JVM(Java Virtual Machine). We will later in this blog discuss about JVM and JRE.
Java Bytecode:
Bytecode is a highly optimized set of instructions designed to be executed by the Java run-time system, called Java Virtual Machine(JVM). When a Java program is compiled, it is not directly compiled into executable code rather it is translated into bytecode which is then executed by JVM. Bytecode ensures the security of the program because it is in non readable form and provides portability because every platform should only implement a JVM, then the bytecode can be executed on that platform with the help of JVM.
Features of Java:
- Simple
- Secure
- Portable
- Object-oriented
- Robust
- Multithreaded
- Architecture-neutral
- High performance
- Distributed
- Dynamic
1. Simple:
Java was designed keeping in mind for it to be easy for new and experienced programmers to learn and use. If you have some experience in programming, then it is not very hard for you to learn and master Java. It will be helpful if you know some concepts like object-oriented programming. Although, if you are an experienced C/C++ programmer, then learning Java comes-in handy because Java inherits its syntax and some features from C and C++.
2. Secure:
Any program or software downloaded from the internet has a potential risk of containing virus, Trojan horse, or other harmful code. These malicious code can cause damage to your computer hardware, read your data or manipulate data once it enters the system. Java provides security by automatic garbage collection and Classloader. Classloader in Java is a part of the Java Runtime Environment (JRE) which is used to load Java classes into the Java Virtual Machine dynamically. It adds security by separating the package for the classes of the local file system from those that are imported from network sources.
3. Portable:
Java provides portability by compiling the program into bytecode and running it into JVM as stated above.
4. Object-oriented:
Java follows the "everything is an object" paradigm. A java program is written in the form of class and objects. By following object-oriented programming paradigm, the program becomes easier to understand and make changes afterwards.
5. Robust:
For developing large and complex programs/software, Java needs to be robust. This is achieved in Java because it manages memory allocation and deallocation for you unlike C and C++ where you need to manually handle memory management. A well written Java program can handle run-time exceptions.
6. Multithreaded:
It is a process where multiple threads(processes) are executed simultaneously. A thread is a small sub-process, which is the smallest unit of processing. Multithreading is used because threads use a shared memory and thus it saves memory space.
7. Architecture-Neutral:
An issue for programmers was that, a program that runs today will surely run tomorrow as well even on the same machine. Operating system upgrades, processor upgrades, or change in core resource can result in the program malfunction. To overcome this issue, Java designers worked on their goal of WORA- "write once; run anywhere, any time, forever". And they were moreover successful in achieving their goal.
8. High performance:
Java is faster than other traditional interpreted programming languages because Java bytecode is "close" to native code. It is still a little bit slower than a compiled language (e.g., C++). Java is an interpreted language that is why it is slower than compiled languages, e.g., C, C++, etc.
9. Distributed:
Java is designed for the distributed environment of the Internet because it handles TCP/IP protocols. In fact, accessing a resource using a URL is not much different from accessing a file. Java also supports Remote Method Invocation(RMI). This feature enables a program to invoke methods across a network.
10. Dynamic:
Java is a dynamic language. It supports the dynamic loading of classes. It means classes are loaded on demand. Java supports dynamic compilation and automatic memory management (garbage collection).
For more blogs click here.
Comments
Post a Comment
If you have any doubts, Please let me know.