What is the difference between an Interface and an Abstract class?
What is the purpose of garbage collection in Java, and when is it used?
Describe synchronization in respect to multithreading.
Explain different way of using thread?
What are pass by reference and passby value?
What is HashMap and Map?
Difference between HashMap and HashTable?
Difference between Vector and ArrayList?
Difference between Swing and Awt?
What is the difference between a constructor and a method?
State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.
What is an abstract class?
What is static in java?
What if the main method is declared as private?
What if the static modifier is removed from the signature of the main method?
What if I write static public void instead of public static void?
What if I do not provide the String array as the argument to the method?
What is the first argument of the String array in main method?
If I do not provide any arguments on the command line, then the String array of Main method will be empty or null?
How can one prove that the array is not null but empty using one line of code?
What environment variables do I need to set on my machine in order to be able to run Java programs?
Can an application have multiple classes having main method?
Can I have multiple main methods in the same class?
Do I need to import java.lang package any time? Why ?
Can I import same package/class twice? Will the JVM load the package twice at runtime?
What are Checked and UnChecked Exception?
What are different types of inner classes?
Are the imports checked for validity at compile time? e.g. will the code containing an import such as java.lang.ABCD compile?
Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*?
What is the difference between declaring a variable and defining a variable?
What is the default value of an object reference declared as an instance variable?
Can a top level class be private or protected?
What type of parameter passing does Java support?
Primitive data types are passed by reference or pass by value?
Objects are passed by value or by reference?
How do I serialize an object to a file?
Which methods of Serializable interface should I implement?
How can I customize the seralization process? i.e. how can one have a control over the serialization process?
What is the common usage of serialization?
What is Externalizable interface?
When you serialize an object, what happens to the object references included in the object?
What one should take care of while serializing the object?
What happens to the static fields of a class during serialization?
Does Java provide any construct to find out the size of an object?
Give a simplest way to find out the time a method takes for execution without using any profiling tool?
What are wrapper classes?
Why do we need wrapper classes?
What are checked exceptions?
What are runtime exceptions?
What is the difference between error and an exception?
How to create custom exceptions?
If I want an object of my class to be thrown as an exception object, what should I do?
If my class already extends from some other class what should I do if I want an instance of my class to be thrown as an exception object?
How does an exception permeate through the code?
What are the different ways to handle exceptions?
What is the basic difference between the 2 approaches to exception handling.
1> try catch block and
2> specifying the candidate exceptions in the throws clause?
When should you use which approach?
Is it necessary that each try block must be followed by a catch block?
If I write return at the end of the try block, will the finally block still execute?
If I write System.exit (0); at the end of the try block, will the finally block still execute?
How are Observer and Observable used?
What is synchronization and why is it important?
How does Java handle integer overflows and underflows?
Does garbage collection guarantee that a program will not run out of memory?
What is the difference between preemptive scheduling and time slicing?
When a thread is created and started, what is its initial state?
What is the purpose of finalization?
What is the Locale class?
What is the difference between a while statement and a do statement?
What is the difference between static and non-static variables?
How are this() and super() used with constructors?
What are synchronized methods and synchronized statements?
What is daemon thread and which method is used to create the daemon thread?
Can applets communicate with each other?
What are the steps in the JDBC connection?
How does a try statement determine which catch clause should be used to handle an exception?
Can an unreachable object become reachable again?
What method must be implemented by all threads?
What is Externalizable?
What modifiers are allowed for methods in an Interface?
What are some alternatives to inheritance?
What does it mean that a method or field is "static"?
What is the catch or declare rule for method declarations?
Is Empty .java file a valid source file?
Can a .java file contain more than one java classes?
Is String a primitive data type in Java?
Is main a keyword in Java?
Is next a keyword in Java?
Is delete a keyword in Java?
Is exit a keyword in Java?
What happens if you dont initialize an instance variable of any of the primitive types in Java?
What will be the initial value of an object reference which is defined as an instance variable?
What are the different scopes for Java variables?
What is the default value of the local variables?
How many objects are created in the following piece of code?
MyClass c1, c2, c3;
c1 = new MyClass ();
c3 = new MyClass ();
Can a public class MyClass be defined in a source file named YourClass.java?
Can main method be declared final?
What will be the output of the following statement?
System.out.println ("1" + 3);
What will be the default values of all the elements of an array defined as an instance variable?
What is the Collections API?
What is the List interface?
What is the Vector class?
What is an Iterator interface?
Which java.util classes and interfaces support event handling?
What is the GregorianCalendar class?
What is the SimpleTimeZone class?
What is the Map interface?
What is the highest-level event class of the event-delegation model?
What is the Collection interface?
What is the Set interface?
What is the typical use of Hashtable?
I am trying to store an object using a key in a Hashtable. And some other object already exists in that location, then what will happen? The existing object will be overwritten? Or the new object will be stored elsewhere?
What is the difference between the size and capacity of a Vector?
Can a vector contain heterogenous objects?
Can a ArrayList contain heterogenous objects?
What is an enumeration?
Considering the basic properties of Vector and ArrayList, where will you use Vector and where will you use ArrayList?
What is a output comment?
What is a Hidden Comment?
What is a Expression?
What is a Declaration?
What is a Scriptlet?
What are implicit objects? List them?
Difference between forward and sendRedirect?
What are the different scope valiues for the ?
Explain the life-cycle mehtods in JSP?
How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
How does JSP handle run-time exceptions?
How can I implement a thread-safe JSP page? What are the advantages and Disadvantages of using it?
How do I use a scriptlet to initialize a newly instantiated bean?
How can I prevent the word "null" from appearing in my HTML input text fields when I populate them with a resultset that has null values?
What's a better approach for enabling thread-safe servlets and JSPs? SingleThreadModel Interface or Synchronization?
How can I enable session tracking for JSP pages if the browser has disabled cookies?
What is the difference b/w variable declared inside a declaration part and variable declared in scriplet part?
Is there a way to execute a JSP from the comandline or from my own application?
Explain the life cycle methods of a Servlet.
What is the difference between the getRequestDispatcher(String path) method of javax.servlet.ServletRequest interface and javax.servlet.ServletContext interface?
Explain the directory structure of a web application.
What are the common mechanisms used for session tracking?
What is preinitialization of a servlet?
What is the difference between Difference between doGet() and doPost()?
What is the difference between HttpServlet and GenericServlet?
What is the difference between ServletContext and ServletConfig?
What is Jakarta Struts Framework?
What is ActionServlet?
How you will make available any Message Resources Definitions file to the Struts Framework Environment?
What is Action Class?
What is Struts Validator Framework?
Give the Details of XML files used in Validator Framework?
How you will display validation fail errors on jsp page?
How you will enable front-end validation based on the xml in validation.xml?
How to get data from the velocity page in a action class?
How EJB Invocation happens?
Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?
The EJB container implements the EJBHome and EJBObject classes. For every request from a unique client, does the container create a separate instance of the generated EJBHome and EJBObject classes?
Can the primary key in the entity bean be a Java primitive type such as int?
Can you control when passivation occurs?
What is the advantage of using Entity bean for database operations, over directly using JDBC API to do database operations? When would I use one over the other?
Brief description about local interfaces?
What are the special design care that must be taken when you work with local interfaces?
What happens if remove( ) is never invoked on a session bean?
What is the difference between Message Driven Beans and Stateless Session beans?
How can I call one EJB from inside of another EJB?
What is an EJB Context?