Difference between >> and >>> - Java
The >> is right shift operator. It shifts bits towards right. For example: 5 >> 1 returns 2. It shifts one bit towards right and one bit is lost...
What is an Anonynous inner class? - Java
Anonymous Inner Classes - An inner class without a name. It allows the declaration of the class, creation of the object and execution of the methods in it at one shot...
What is object deep copy and shallow copy? - Java
In deep copy the copy operations would respect the semantics of the object. For example, copying an object along with the objects to which it refers to...
What is dynamic variable in java and where do we use them?
The variables that are initialized at run time is called as dynamic variable...
Explain the advantages of JTA over JTS
Java Transaction API is simple and more flexible to use. There are two levels in JTA API...
What is a resource leak?
Usually all operating systems have limitations for using the number of file handles, sockets etc., which can be open...
What is Bootstrap loader program?
Bootstrapping is a technique which activates more complex / complicated system of programs...
Can you run the java program without main method? - Java
A java applet application, a web application can run without main method. A Java program can run without using ‘ public static void main(String args[]) ‘ method by using a static block...
Can you explain why servlets extend HttpServlet?
Most of the web applications uses HTTProtocol. The user requests need to be received and processed through the HTTProtocol...
What is Servlet Filter and how does it work?
Filters are powerful tools in servlet environment. Filters add certain functionality to the servlets apart from processing request and response paradigm of servlet processing...
Explain the use of logic:iterate tag in struts application
The tag is utilized for repeating the nested body content over a collection. Every element / object in a specified collection...
Difference between DataInputStream and BufferedReader
The differences are: The DataInputStream works with the binary data, while the BufferedReader work with character data...
Difference between throw and throws - Java
The throw key word is used to explicitly throw an exception, while throws is utilized to handle checked exceptions for re-intimating the compiler that exceptions are being handled...
Explain the ways to serialize the java object
Object serialization could be used in different ways: - Simple persistence of the object...
Similarities between an array and an ArrayList - Java
The following are the similarities between an array and an ArrayList: - Both array and ArrayList can have duplicate elements in them...
Can we decide a session bean as stateless or stateful without seeing jar file?
A bean can be determined whether is a stateless or stateful by analyzing the deployment descriptor ejb-jar.xml...
What is non static block in java?
The non-static block code is executed when a new class is instantiated. It executes before the constructor’s execution...
Explain how to sort the elements in HashMap - Java
The elements of HashMap can be sorted by using the static method Collections.sort()...
Difference between Checked and Unchecked exception
A checked exception throws a block of code and represented by the throws keyword...
Why Runnable interface is preferable than extending the Thread class - Java
Runnable interface is always preferred because, the class implementing it can implement as many interfaces as a developer can, and also extend another class...
Difference between a java object reference and c++ pointer
The prime difference is that pointers are to locate the address of the primitive variables only...
What is JasperReports?
Jasper Report is a very popular open source reporting tool written in Java. The reports can be seen on the screen, on a printer...
Spring framework vs. Struts framework
Struts: Struts is a MVC pattern framework, Generating integration logic is done dynamically using Struts...
Explain how to convert java file to jar files
The following is the process: - Type jar –cvf <.java file(s)>...
Describe how to use crystal reports in java.
Create an object of CrystalReport class. - Invoke aboutBox() method – for confirmation whether it is loaded properly - Establish the connection by using setConnect() method...
Why java doesn't support multiple inheritance
Java does not support multiple inheritances. To avoid ambiguity problem – Diamonds of Death – and complexity of multiple inheritance...
What is the use of private constructor in Java?
A private constructor is used when there is no requirement of another class to invoke that. It is used mostly in implementing singletons...
Explain how to make a class immutable - Java
In order to make a class immutable, the changing state of the class object must be restricted. This means restricting an assignment to a variable...
Java methods are virtual by default. Comment
Java methods are virtual by default. The virtual methods are the methods of subclasses...
How a class implements an interface in Java.
First ,the interface is to be defined. Defining an interface is placing the method signatures...
Concrete class vs. Abstract class vs. Interface in Java
A concrete class has concrete methods, i.e., with code and other functionality...
How do I design a class so that it supports cloning in Java?
Deep cloning builds a new reference and a new object to refer to a new object...
Explain the complete syntax for using the Applet tag.
The Applet tag has the following attributes...
Where should we put applet class files, and how to indicate their location using the Applet tag?
An applet class file may present in any of the folder. The .class file name along with its current path...
Explain the methods that control a Applet's on-screen appearance, update and paint.
To refresh a page in an applet window without flashing, the update() method is to be overridden...
Explain how Java interacts with database.
Java interacts with database using an API called Java Database Connectivity. JDBC is used to connect to the database...
How can we handle SQL exception in Java?
SQL Exception is associated with a failure of a SQL statement. This exception can be handled like an ordinary exception in a catch block...
What is DatabaseMetaData in Java?
DatabaseMetaData provides comprehensive information about the database...
What is ResultSetMetaData in Java?
ResultSetMetaData is a class which provides information about a result set that is returned by an executeQuery() method...
CacheRowset, JDBCRowset and WebRowset in Java.
A CacheRowSet object is a container for rows, that ‘caches’ the rows in the memory...
Different types of locks in JDBC
A lock is a preventive software mechanism that other users can not use the data resource...
How are Observer and Observable used in Java?
All the objects which are the instances of the sub class Observable, maintains a list of observers...
What is synchronization and why is it important in Java?
Synchronization is the process of allowing threads to execute one after another...
Difference between preemptive scheduling and time slicing in Java
Preemptive scheduling enables the highest priority task execution until waiting or dead states entered...
What is a task's priority and how is it used in scheduling?
A task’s priority is an integer value. This value is used to identify the relative order of execution with respect to other tasks...
Difference between the Boolean & operator and the && operator
A single ampersand is used to perform ‘bit-wise AND’ operation on integer arguments. It constitutes the logical AND operator...
Java - Advantage of the event-delegation model over event inheritance model.
Event-delegation model has two advantages over event-inheritance model...
What is the purpose of the wait(), notify(), and notifyAll() methods?
The wait() method makes the thread to halt, thus allowing other thread to perform...
Event-listener interface and an event-adapter class
An event-listener interface allows describing the methods which must be implemented...
What is the purpose of the enableEvents() method?
To enable a particular event of an object, the enableEvents() method is utilized...
Difference between the File and RandomAccessFile classes in Java?
The OS based file system services such as creating folders, files, verifying the permissions, changing file names etc...