Java Programming Questions
Languages
25. | What are the types of class loader? |
---|---|
There are three types of class loaders are
Bootstrap class loader finds these necessary classes from "jdk/jre/lib/rt.jar". Bootstrap class loader cannot be instantiated from JAVA code and is implemented natively inside JVM. Extension Class loader also termed as the standard extensions class loader is a child of the bootstrap class loader. Its primary responsibility is to load classes from the extension directories, normally located the "jre/lib/ext" directory. This provides the ability to simply drop in new extensions, such as various security extensions, without requiring modification to the users class path. System Class loader also termed application class loader is the class loader responsible for loading code from the path specified by the CLASSPATH environment variable. It is also used to load an application's entry point that is the "static void main ()" methods in a class. |
26. | What are packages? |
---|---|
Packages group related classes and interfaces together and thus avoiding any name conflicts. From OOP's point of view packages are useful for grouping related classes together. Classes are group together in a package using "package" keyword. |
27. | What are the types of JIT Compilation? |
---|---|
There are two basic ways languages are compiled:
|
28. | What is Assertion? |
---|---|
Assertion includes a Boolean expression. If the Boolean expression evaluates to false. AssertionError is thrown. Assertion helps a programmer to debug the code effectively. Assertion code is removed when the program is deployed. |