Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

1. Why is Java known as a platform-neutral language?

Ans.
Java is known as platform-neutral language because Java's bytecodes are designed to be read, interpreted, and
executed in exactly the same manner on any computer hardware or operating system that supports a Java run-time.
2. How is Java more secure than other languages?
Ans.
One of the potential terrors of the Internet is the possibility of security breaches- viruses that infect your computer, or
hackers who take advantage of a software glitch to invade your personal cyberspace and make off with confidential
information.
Applets, which are Java programs, are automatically downloaded when a Web page is displayed. Java applets, by
default, execute within the Java executing environment and are limited to the environment. This means, an applet cannot
access the local file system or other programs of the system where it executes. This reduces the chance that simply
viewing someone's page might harm your system or data. No system is absolutely reliable and none will ever be; but Java
represents the state-of-the-art in reducing the chances of a disaster.
3. What is multithreading? How does it improve the performance of Java?
Ans.
In a multithreading environment, a thread is the smallest unit of dispatchable code. This means that a single program can
perform two or more tasks simultaneously. For instance a text editor can format text at the same time that it is printing.
The benefit of Java's multithreading is that the main loop/polling mechanism is eliminated. One thread can pause without
stopping other parts of the program. For example, the idle time created when a thread reads data from a network or waits
for user input can be utilized elsewhere. When a thread blocks in a Java program, only the single thread that is blocked
pauses. All other threads continue to run.

You might also like