Java Interview Questions – 48

Java Interview Questions – 48 1. 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 2. What is the relationship between an event-listener interface and an event-adapter class? An event-listener interface allows describing the methods which must […]

Java Interview Questions -41

Java Interview Questions -41 1.What are important ApplicationContext implementations in spring framework? ClassPathXmlApplicationContext – This context loads a context definition from an XML file located in the class path, treating context definition files as class path resources. FileSystemXmlApplicationContext – This context loads a context definition from an XML file in the filesystem. XmlWebApplicationContext – This […]

Java Interview Questions -32

Java Interview Questions -32 1.What is a SessionFactory? Is it a thread-safe object? SessionFactory is Hibernates concept of a single datastore and is threadsafe so that many threads can access it concurrently and request for sessions and immutable cache of compiled mappings for a single database. A SessionFactory is usually only built once at startup. […]

Core Java Interview Questions -26

Core Java Interview Questions -26 1:Can an application have multiple classes having main method? Yes it is possible. While starting the application we mention the class name to be run. The JVM will look for the Main method only in the class whose name you have mentioned. Hence there is not conflict amongst the multiple […]

Java Interview Questions -24

 Java Interview Questions -24 1. How could Java classes direct program messages to the system console, but error messages, say to a file?  The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This […]

Java Interview Questions – 21

Java Interview Questions – 21 1.In System.out.println(),what is System,out and println,pls explain?  System is a predefined final class,out is a PrintStream object acting as a field member and println is a built-in overloaded method in the out object. 2.Can you write a Java class that could be used both as an applet as well as […]

Java Interview Questions -18

Java Interview Questions -18 1.What are the types of JDBC Driver Models and explain them? – There are two types of JDBC Driver Models and they are: a) Two tier model and b) Three tier model Two tier model: In this model, Java applications interact directly with the database. A JDBC driver is required to […]

Java Interview Questions -17

Java Interview Questions -17 1. How does a try statement determine which catch clause should be used to handle an exception? When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is […]

Java Interview Questions -16

Java Interview Questions -16 1.When can an object reference be cast to an interface reference? An object reference can be cast to an interface reference when the object implements the referenced interface. 2.What are Regular Inner Classes? A Regular inner class is declared inside the curly braces of another class outside any method or other […]

Java Interview Questions -15

Java Interview Questions -15 1.What are the 3 ways to represent an integer value? The following are the 3 different ways to represent an integer value:int i = 123 // this is the usual decimal representation.int i = 0123 // this is octal representation. Octal values start with a zero.int i = 0XCAAD // this […]