Number of View: 26
37) Collections :
Collections class contains several static methods and constants which are useful for working with collections.Collections defines several algorithms which can be applied to collection objects.
Collections contains several static methods.
Number of View: 20
31) ClassLoaders :
Class loaders in java are used to load classes at runtime.
There are 3 different class loaders in java :
Bootstrap class loader
Extension class loader
System class loader.
32) Class method :
Class methods are also called as static methods.
Static members are used by other classes without creating an instance of the class.
Static methods do not operate on objects.
Methods are declared as static when they perform operations independent of instance variables.
Static method belongs to whole class not to particular instance.
Static method operate only on static data and cannot access non static data such as instance variables.
A static method can call other static method but cannot call non static methods.
A static method cannot refer to super or this keyword.
Example : Math class which contains only static fields and methods.
To call static method use class name followed by dot.
Note : JDK 8 added a new feature static methods can be defined in interface.Just like how we call static methods in class in the same way we call static methods in interface.
Number of View: 24
26) Cast :
Casting is used to convert one datatype in to another.We can use casting to convert double to int.In casting there is a chance to lose information.
For example : when converting double to int.
27) Catch :
Catch block is used to catch the exception.Catch block gets executed whenever an exception is thrown.Each catch block is an exception handler that handles the exception indicated by its argument.
Prior to java 7 catch block can handle only type of exception.From Java 7 a catch block can handle more than one type of exception.
Catch blocks are associated with try blocks.For every try block there should be atleast one catch block or finally block.
Number of View: 67
Explain http protocol in detail?
1) HTTP Protocol is an client server tcp based protocol.
2) Browser or client communicates with web server using http protocol.
3) Client sends the HTTP request and sends to the server.
4) The webserver receives the request and processes the request and generates the response.
Number of View: 33
1) WebServer takes the client request and gives response back to the client.
2) Whenver the client sends request it can be static resource or it can be dynamic resource.
Number of View: 49
Explain the important components of Webapplication?
1) Browser can be either internet explorer,Mozilla or safari.Browser is used to send the request to the server.
2) Webserver is the place where actual webapplication is deployed.Whenever browser sends request it sends it to the webserver.webserver gets the resource requested by client from DBMS or from any other external sources and gives the response back to the client.
Number of View: 31
What is web application ?
Webapplication is collection of web pages which are generated in response to user requests.
A web page contains information.It may be either static content such as simple html page or it can contain dynamic content.
Number of View: 88
This program explains you how to pass initialization parameters from web.xml and capture it to servlet.
Iam taking two files to write this program:
1) web.xml : Here we will pass init-params information.
2) InitParamsServlet : In this java class we will capture params information.
Number of View: 1708
1) Servlet config is used by servletcontainer to communicate to servlet.After init() method is called by servlet container ,it passes the servlet config object to the servlet.
2) The servletconfig contains information that we can pass to the servlet using deployment descriptor.
Number of View: 55
Difference between Generic Servlet and HTTP servlet ?
1) Generic Servlet is subclass of Servlet interface.
1) Http Servlet is subclass of Generic Servlet.
2) Generic servlets are protocol independent .It can access http,ftp etc
2) Http Servlets are protocol dependent.It can access only http and https protocol.