features
features
features
Compiler converts source code to byte code and then the JVM executes the bytecode
generated by the compiler. This byte code can run on any platform be it Windows, Linux, or
macOS which means if we compile a program on Windows, then we can run it on Linux and
vice versa.
Java's syntax is simple and easy to learn, especially for those familiar with C or C++. It
eliminates complex features like pointers and multiple inheritances, making it easier to write,
debug, and maintain code.
java compiler is able to detect even those errors that are not easy to detect by another
programming language. The main features of java that make it robust are garbage collection,
exception handling, and memory allocation.
5.
java programs run in an environment that is independent of the os(operating
system) environment which makes java programs more secure. With Java, we can develop virus-
free systems. Java is secured because:
No explicit pointer
Java Programs run inside a virtual machine sandbox
o 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.
o Bytecode Verifier: It checks the code fragments for illegal code that can violate access
rights to objects.
o Security Manager: It determines what resources a class can access such as reading and
writing to the local disk.
We can create distributed applications using the java programming language. Remote Method
Invocation and Enterprise Java Beans are used for creating distributed applications in java. The
java programs can be easily distributed on one or more systems that are connected to each
other through an internet connection.
A thread is like a separate program, executing concurrently. We can write Java programs that deal
with many tasks at once by defining multiple threads. The main advantage of multi-threading is
that it doesn't occupy memory for each thread. It shares a common memory area. Threads are
important for multi-media, Web applications, etc.
ava code written on one machine can be run on another machine. The platform-independent
feature of java in which its platform-independent bytecode can be taken to any platform for
execution makes java portable
Java architecture is defined in such a way that it reduces overhead during the runtime and at
sometimes java uses Just in Time (JIT) compiler where the compiler compiles code on-demand
basis where it only compiles those methods that are called making applications to execute
faster.
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.