October 13, 2018

Sreekanth B

Radware Most Frequently Asked Core Java Interview Questions Answers

What An I/o Filter?

An I/O filter is an object that reads from one stream and writes to another, usually altering the data in some way as it is passed from one stream to another.

What Is The Purpose Of Finalization?

The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.

Which Class Should You Use To Obtain Design Information About An Object?

The Class class is used to obtain information about an object’s design.

What Is The Purpose Of The System Class?

The purpose of the System class is to provide access to system resources.

Can We Use The Constructor, Instead Of Init(), To Initialize Servlet?

Yes , of course you can use the constructor instead of init(). There’s nothing to stop you. But you shouldn’t. The original reason for init() was that ancient versions of Java couldn’t dynamically invoke constructors with arguments, so there was no way to give the constructur a ServletConfig. That no longer applies, but servlet containers still will only call your no-arg constructor. So you won’t have access to a ServletConfig or Servlet Context.
Radware Most Frequently Asked Core Java Interview Questions Answers
Radware Most Frequently Asked Core Java Interview Questions Answers

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

You can use a client-side Refresh or Server Push.

The Code In A Finally Clause Will Never Fail To Execute, Right?

Using System.exit(1); in try block will not allow finally code to execute.

How Many Messaging Models Do Jms Provide For And What Are They?

JMS provide for two messaging models, publish-and-subscribe and point-to-point queuing.

What Information Is Needed To Create A Tcp Socket?

The Local System?s IP Address and Port Number. And the Remote System’s IPAddress and Port Number.

What Class.forname Will Do While Loading Drivers?

It is used to create an instance of a driver and register it with the DriverManager. When you have loaded a driver, it is available for making a connection with a DBMS.

How Many Jsp Scripting Elements Are There And What Are They?

There are three scripting language elements: declarations, scriptlets, expressions.

What Are Stored Procedures? How Is It Useful?

A stored procedure is a set of statements/commands which reside in the database. The stored procedure is pre-compiled and saves the database the effort of parsing and compiling sql statements everytime a query is run. Each database has its own stored procedure language, usually a variant of C with a SQL preproceesor. Newer versions of db’s support writing stored procedures in Java and Perl too. Before the advent of 3-tier/n-tier architecture it was pretty common for stored procs to implement the business logic( A lot of systems still do it). The biggest advantage is of course speed. Also certain kind of data manipulations are not achieved in SQL. Stored procs provide a mechanism to do these manipulations. Stored procs are also useful when you want to do Batch updates/exports/houseKeeping kind of stuff on the db. The overhead of a JDBC Connection may be significant in these cases.

How Do I Include Static Files Within A Jsp Page?

Static resources should always be included using the JSP include directive. This way, the inclusion is performed just once during the translation phase. Do note that you should always supply a relative URL for the file attribute. Although you can also include static resources using the action, this is not advisable as the inclusion is then performed for each and every request.

Why Does Jcomponent Have Add() And Remove() Methods But Component Does Not?

Because JComponent is a subclass of Container, and can contain other components and jcomponents.

How Can I Implement A Thread-safe Jsp Page?

You can make your JSPs thread-safe by having them implement the SingleThreadModel interface. This is done by adding the directive <%@ page isThreadSafe="false" % > within your JSP page.

What Is The Difference Between Procedural And Object-oriented Programs?

a) In procedural program, programming logic follows certain procedures and the instructions are executed one after another. In OOP program, unit of program is object, which is nothing but combination of data and code.
b) In procedural program, data is exposed to the whole program whereas in OOPs program, it is accessible with in the object and which in turn assures the security of the code.

Subscribe to get more Posts :