Collections Java Interview Questions – Set 03

What is the importance of hashCode() and equals() methods? How they are used in Java The java.lang.Object has two methods defined in it. They are – public boolean equals(Object obj) public int hashCode(). These two methods are used heavily when objects are stored in collections. There is a contract between these two methods which should … Read more

Beans Java Interview Questions – Set 03

What are the different types of IoC (dependency injection There are three types of dependency injection: Constructor Injection(e.g. Spring): Dependencies are provided as constructor parameters. Setter Injection(e.g. Spring): Dependencies are assigned through JavaBeans properties (ex: setter methods). Interface Injection(e.g. Avalon): Injection is done through an interface. In your experience, why would you use Spring framework … Read more

Hibernate Java Interview Questions – Set 03

What is a SessionFactory? Is it a thread-safe object SessionFactory is Hibernate’s 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. SessionFactory should be wrapped … Read more

JSP Java Interview Questions – Set 03

Name one advantage of JSP over Servlets Can contain HTML, JavaScript, XML and Java Code whereas Servlets can contain only Java Code, making JSPs more flexible and powerful than Servlets. However, Servlets have their own place in a J2EE application and cannot be ignored altogether. They have their strengths too which cannot be overseen. What … Read more

Exception Handling Java Interview Questions – Set 03

What happens if an exception is not caught An uncaught exception results in the uncaughtException() method of the thread’s ThreadGroup being invoked, which eventually results in the termination of the program in which it is thrown. What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of … Read more

Web Services Interview Questions – Set 03

What is WSDL? The WSDL stands for Web Services Description Language. It is an XML document containing information about web services such as method name, method parameter. The Client needs a data dictionary which contains information about all the web services with methods names and parameters list to invoke them for the web services. The … Read more

Servlet Java Interview Questions – Set 03

What is connection pooling?- With servlets, opening a database connection is a major bottleneck because we are creating and tearing down a new connection for every page request and the time taken to create connection will be more. Creating a connection pool is an ideal approach for a complicated servlet. With a connection pool, we … Read more

JDBC Java Interview Questions – Set 03

What does setAutoCommit(false) do A JDBC connection is created in auto-commit mode by default. This means that each individual SQL statement is treated as a transaction and will be automatically committed as soon as it is executed. If you require two or more statements to be grouped into a transaction then you need to disable … Read more

AWS Interview Questions – Set 03

What is VPC peering connection? A VPC peering connection is a networking connection that allows you to connect one VPC with another VPC through a direct network route using private IP addresses. By using VPC peering connection, instances in different VPC can communicate with each other as if they were in the same network. You … Read more

Android Interview Questions – Set 03

How are view elements identified in the android program? View elements can be identified using the keyword findViewById. What is ADB? ADB stands for Android Debug Bridge. It is a command line tool that is used to communicate with the emulator instance. What is a portable wi-fi hotspot? The portable wi-fi hotspot is used to … Read more