Application server and web server in Java both are used to host Java web application. Though both application server and web server are generic terms, difference between application server and web server is a famous J2EE interview question. On Java J2EE perspective main difference between web server and application server is support of EJB. In order to run EJB or host enterprise Java application (.ear) file you need an application server like JBoss, WebLogic, WebSphere or Glassfish, while you can still run your servlet and JSP or java web application (.war) file inside any web server like Tomcat or Jetty.
This Java interview question are in continuation of my previous post on interviews like Top 10 Spring interview questions and Top 10 Struts interview question. Here we will see some difference between application server and web server in point format which will help you to answer this question in any java interview.