What is the difference between checked and unchecked exceptions?

In general, unchecked exceptions represent defects in the program (bugs), which are normally Runtime exceptions. Furthermore, checked exceptions represent invalid conditions in areas outside the immediate control of the program. Explain Checked Exceptions and Unchecked Exceptions with examples Unchecked exceptions : represent defects in the program (bugs) – often invalid arguments passed to a non-private … Read more

What are the differences between checked and unchecked exceptions?

A checked exception is any subclass of Exception (or Exception itself), excluding class RuntimeException and its subclasses. Making an exception checked forces client programmers to deal with the possibility that the exception will be thrown. eg, IOException thrown by java.io.FileInputStream’s read() method Unchecked exceptions are RuntimeException and any of its subclasses. Class Error and its … Read more

What is the difference between forward and sendredirect?

Both method calls redirect you to new resource/page/servlet. The difference between the two is that sendRedirect always sends a header back to the client/browser, containing the data in which you wanted to be redirected. In Java, particularly in the context of servlets and JSP (JavaServer Pages), forward and sendRedirect are two different mechanisms used for … Read more

Explain the Struts1/Struts2/MVC application architecture?

Struts was adopted by the Java developer community as a default web framework for developing web applications The MVC(Model–view–controller) an application that consist of three distinct parts. The problem domain is represented by the Model. The output to the user is represented by the View. And, the input from the user is represented by Controller. … Read more

What is the difference between web server and app server?

A Web server exclusively handles HTTP requests, whereas an application server serves business logic to application programs through any number of protocols. In the context of Core Java, the difference between a web server and an application server lies primarily in their roles and functionalities within a web application architecture: Web Server: Role: A web … Read more