Explore topic-wise InterviewSolutions in Current Affairs.

This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.

1.

How Does Jsp Handle Run-time Exceptions?

Answer»

You can USE isErrorPage=”TRUE” in PAGE ATTRIBUTE

You can use isErrorPage=”true” in page attribute

2.

How Can A Servlet Refresh Automatically If Some New Data Has Entered The Database?

Answer»

Basically it depends on the scenario , how you can HANDLE. You need handle this in dao layer, when doing insert OPERATION you can CALL an utility method which will LOAD the context ServletContextListener. Because, servlets are basically used for handling request and give the response.

Basically it depends on the scenario , how you can handle. You need handle this in dao layer, when doing insert operation you can call an utility method which will load the context ServletContextListener. Because, servlets are basically used for handling request and give the response.

3.

How To Improve Servlet Performance ?

Answer»

You NEED to do few tuning for this achievement. Few points below:

  1. Use init() METHOD for all expensive operation during initialization (may be static data or cached data ).
  2. ALWAYS AVOID auto loading of SERVLET.
  3. Avoid SingleThreadModel.
  4. Use and control HttpSession properly.

You need to do few tuning for this achievement. Few points below:

4.

What Is The Importance Of Init() Method In Servlet?

Answer»

INIT() method is one of the life cycle method of servlet. This method runs once in total life. After servlet INSTANCE created and before it HANDLES request the init() method will work. Its basically USED for initializing VALUES at the time of application startup.

init() method is one of the life cycle method of servlet. This method runs once in total life. After servlet instance created and before it handles request the init() method will work. Its basically used for initializing values at the time of application startup.

5.

Can You Give Few Examples Of Final Classes Defined In Java Api?

Answer»

String, Integer ,Float ,ETC. BASICALLY all wrapper classed are FINAL.

String, Integer ,Float ,etc. Basically all wrapper classed are final.

6.

What Is Marker Interface? How Is It Used In Java?

Answer»

Marker interface is an interface which help us to NOTIFY few information to JVM/Compiler. The marker interface does not have any BODY, it’s a empty interface. Ex. Cloneable, SERIALIZATION, ETC.

Marker interface is an interface which help us to notify few information to JVM/Compiler. The marker interface does not have any body, it’s a empty interface. Ex. Cloneable, Serialization, etc.

7.

What Is The Purpose Of Garbage Collection In Java, And When Is It Used?

Answer»

Garbage collection is a special FEATURE in java LANGUAGE. It helps DEVELOPER to save TIME and extra mental tension for handling object allocation in memory. It automatically clean the unused object from memory which helps to allocate space at runtime. When there is no reference to an object FOUND, it will clean that object from memory . You can run the garbage collection explicitly by using System.gc().

Garbage collection is a special feature in java language. It helps developer to save time and extra mental tension for handling object allocation in memory. It automatically clean the unused object from memory which helps to allocate space at runtime. When there is no reference to an object found, it will clean that object from memory . You can run the garbage collection explicitly by using System.gc().

8.

What Is The Difference Between An Interface And An Abstract Class?

Answer»

Both are looks similar. But, the basic difference is ABSTRACT class can contain abstract and non abstract methods, where interface only contains abstract METHOD (without method body). You can DECLARE fields that are not static and final, and define PUBLIC, protected, and private CONCRETE methods in abstract class. But, in Interface all members are public, static and final , all methods are public.

Both are looks similar. But, the basic difference is abstract class can contain abstract and non abstract methods, where interface only contains abstract method (without method body). You can declare fields that are not static and final, and define public, protected, and private concrete methods in abstract class. But, in Interface all members are public, static and final , all methods are public.

9.

Is Java Pass By Reference Or Pass By Value?

Answer»

Its ALWAYS PASS by VALUE .

Its always pass by value .

Previous Next