Keyword

Result: 191 questions

What is the difference between a Scrollbar and a JScrollPane ?

Answer:

Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPanehandles its own events and performs its own scrolling.

View

Name three Component subclasses that support painting.

Answer:

The CanvasFramePanel, and Applet classes support painting.

View

What is the difference between a MenuItem and a CheckboxMenuItem ?

Answer:

The CheckboxMenuItem class extends the MenuItem class and supports a menu item that may be either checked or unchecked.

View

How are the elements of a BorderLayout organized ?

Answer:

The elements of a BorderLayout are organized at the borders (North, South, East, and West) and the center of a container.

View

How are the elements of a GridBagLayout organized ?

Answer:

The elements of a GridBagLayout are organized according to a grid. The elements are of different sizes and may occupy more than one row or column of the grid. Thus, the rows and columns may have different sizes.

View

What is the difference between a Window and a Frame ?

Answer:

The Frame class extends the Window class and defines a main application window that can have a menu bar.

View

What advantage do Java’s layout managers provide over traditional windowing systems ?

Answer:

Java uses layout managers to lay out components in a consistent manner, across all windowing platforms. Since layout managers aren’t tied to absolute sizing and positioning, they are able to accomodate platform-specific differences among windowing systems.

View

What is the design pattern that Java uses for all Swing components ?

Answer:

The design pattern used by Java for all Swing components is the Model View Controller (MVC) pattern.

View

What is JDBC ?

Answer:

JDBC is an abstraction layer that allows users to choose between databases. JDBC enables developers to write database applications in Java, without having to concern themselves with the underlying details of a particular database.

View

Explain the role of Driver in JDBC.

Answer:

The JDBC Driver provides vendor-specific implementations of the abstract classes provided by the JDBC API. Each driver must provide implementations for the following classes of the java.sql package:ConnectionStatementPreparedStatementCallableStatementResultSet and Driver.

View

What is the advantage of PreparedStatement over Statement ?

Answer:

PreparedStatements are precompiled and thus, their performance is much better. Also, PreparedStatement objects can be reused with different input values to their queries.

View

What is the use of CallableStatement ? Name the method, which is used to prepare a CallableStatement.

Answer:

CallableStatement is used to execute stored procedures. Stored procedures are stored and offered by a database. Stored procedures may take input values from the user and may return a result. The usage of stored procedures is highly encouraged, because it offers security and modularity.The method that prepares a CallableStatement is the following:

CallableStament.prepareCall();

 

View

What does Connection pooling mean ?

Answer:

The interaction with a database can be costly, regarding the opening and closing of database connections. Especially, when the number of database clients increases, this cost is very high and a large number of resources is consumed.A pool of database connections is obtained at start up by the application server and is maintained in a pool. A request for a connection is served by a connection residing in the pool. In the end of the connection, the request is returned to the pool and can be used to satisfy future requests.

View

What is RMI ?

Answer:

The Java Remote Method Invocation (Java RMI) is a Java API that performs the object-oriented equivalent of remote procedure calls (RPC), with support for direct transfer of serialized Java classes and distributed garbage collection. Remote Method Invocation (RMI) can also be seen as the process of activating a method on a remotely running object. RMI offers location transparency because a user feels that a method is executed on a locally running object. Check some RMI Tips here.

View

What is the role of the java.rmi.Naming Class ?

Answer:

The java.rmi.Naming class provides methods for storing and obtaining references to remote objects in the remote object registry. Each method of the Naming class takes as one of its arguments a name that is a String in URL format.

View

Explain Serialization and Deserialization.

Answer:

Java provides a mechanism, called object serialization where an object can be represented as a sequence of bytes and includes the object’s data, as well as information about the object’s type, and the types of data stored in the object. Thus, serialization can be seen as a way of flattening objects, in order to be stored on disk, and later, read back and reconstituted. Deserialisation is the reverse process of converting an object from its flattened state to a live object.

View

What is a Servlet ?

Answer:

The servlet is a Java programming language class used to process client requests and generate dynamic web content. Servlets are mostly used to process or store data submitted by an HTML form, provide dynamic content and manage state information that does not exist in the stateless HTTP protocol.

View

Explain the architechure of a Servlet.

Answer:

The core abstraction that must be implemented by all servlets is the javax.servlet.Servlet interface. Each servlet must implement it either directly or indirectly, either by extending javax.servlet.GenericServlet or javax.servlet.http.HTTPServlet. Finally, each servlet is able to serve multiple requests in parallel using multithreading.

View

What is the difference between an Applet and a Servlet ?

Answer:

An Applet is a client side java program that runs within a Web browser on the client machine. On the other hand, a servlet is a server side component that runs on the web server.An applet can use the user interface classes, while a servlet does not have a user interface. Instead, a servlet waits for client’s HTTP requests and generates a response in every request.

View

What is the difference between GenericServlet and HttpServlet ?

Answer:

GenericServlet is a generalized and protocol-independent servlet that implements the Servlet and ServletConfig interfaces. Those servlets extending the GenericServlet class shall override the service method. Finally, in order to develop an HTTP servlet for use on the Web that serves requests using the HTTP protocol, your servlet must extend the HttpServlet instead. Check Servlet examples here.

View

© 2017 QuizBucket.org