Some major features of java are as follow:-
- Platform independent
- High Performance
It is simple because:
- The syntax of Java is based on C++. Programmers can easily learn it after C++.
- There were many complicated and rarely-used features that have been removed from Java, for instance, explicit pointers, operator overloading, etc.
- It has a Garbage Collector which is always used to collect unused Memory locations for improving the performance of a Java program.
- The user-friendly syntax for developing any applications.
Java is platform-independent which means you can run a program in any platform(Windows, Linux, Mac, etc.) without modifying any of the code. It is also called WORA (Write Once Run Anywhere). This is all possible because of JVM.
If we talk about c and c++, which are compiled into platform-specific machines but Java is a write once, run anywhere language. Because it generates the .class file or the bytecode while c, c++ generates object code at the compile-time and bytecode can be run on any Operating system But object code can not run on any Operating system.
We all are aware that Java supports OOP’s concepts because it is the most secure language and everything that is present in Java is basically an object.
Object means a real-world entity such as a pen, dog, car, computer, watch, etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects. It simplifies software development and maintenance by providing some concepts:
List of OOP’s Concepts in Java
Java is secured because:
- Java compiles as a bytecode which then runs inside a Virtual machine, it cannot access the computer it runs on like a natively compiled program can.
It provides guarantees and tools for security, such as:
- No buffer-overflow exploits.
- Byte-code verification.
- Security permissions for different codebases.
- Security-related APIs.
- Automatic array bounds checking.
- Exception Handling.
- Memory management.
- Compile-time checking.
Java is Robust because it is a highly supported language. Robust means are strong, rich and full-bodied. Java is robust because:
- Java has a Strong type checking mechanism.
- It is a highly supported language that means it’s rich.
- Java provides Powerful exception handling.
- It has a feature of Automatic memory management and Garbage collection.
- It has a two-time execution strategy that is compilation and interpretation, therefore provides reliability.
Java is known as a “portable language” because Java code can execute on all major platforms. What’s more, once you’ve compiled your Java source to byte-code or .class file, those files can be used on any Java-supported platform without modification, unlike many other languages, which require compiling machine code for each platform.
Java is both compiled or interpreted language. The First Java language is compiled into JVM bytecode which JRE can understand. ByteCode is then interpreted by the JVM making it an interpreted language.
In Java, Multithreading is a process of executing two or more threads simultaneously to maximum utilization of CPU. Each thread runs parallel to each other.