Set - 7

Question 41 :

What is the Java Virtual Machine?

Answer :

The Java Virtual Machine is a software that can be ported onto various hardware-based platforms.

Question 42 :

What is the Java API?

Answer :

The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets.

Question 43 :

What is the package?

Answer :

The package is a Java namespace or part of Java libraries. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages.

Question 44 :

What is native code?

Answer :

The native code is code that after you compile it, the compiled code runs on a specific hardware platform.

Question 45 :

Explain the user defined Exceptions?

Answer :

User defined Exceptions are the separate Exception classes defined by the user for specific purposed. An user defined can created by simply sub-classing it to the Exception class. This allows custom exceptions to be generated (using throw) and caught in the same way as normal exceptions.

class myCustomException extends Exception {
 // The class simply has to exist to be an exception