Question-121. What is an applet ?
Answer- An applet is a Java program that runs in a Web browser. An applet can be a fully functional Java application because it has the entire Java API at its disposal.
Question-122. What is JIT compiler ?
Answer- Just-In-Time(JIT) compiler: It is used to improve the performance. JIT compiles parts of the byte code that have similar functionality at the same time, and hence reduces the amount of time needed for compilation. Here the term “compiler” refers to a translator from the instruction set of a Java virtual machine (JVM) to the instruction set of a specific CPU.
Question-123. Why Java is considered dynamic ?
Answer- It is designed to adapt to an evolving environment. Java programs can carry extensive amount of run-time information that can be used to verify and resolve accesses to objects on run-time.
Question-124. What is Singleton class ?
Answer- Singleton class control object creation, limiting the number to one but allowing the flexibility to create more objects if the situation changes.
Question-125. How is finally used under Exception Handling ?
Answer- The finally keyword is used to create a block of code that follows a try block. A finally block of code always executes, whether or not an exception has occurred.
Question-126. When is super keyword used ?
Answer- If the method overrides one of its superclass’s methods, overridden method can be invoked through the use of the keyword super. It can be also used to refer to a hidden field.
Question-127. Explain garbage collection in Java ?
Answer- It uses garbage collection to free the memory. By cleaning those objects that is no longer reference by any of the program.
Question-128. Define immutable object ?
Answer- An immutable object can’t be changed once it is created.
Question-129. Define the usage of this() with constructors ?
Answer- It is used with variables or methods and used to call constructor of same class.
Question-130. Define TreeSet ?
Answer- It is a Set implemented when we want elements in a sorted order.