Nov 15

Java Glossary/ Dictionary-Letter C-part 7

31) ClassLoaders :

Class loaders in java are used to load classes at runtime.

There are 3 different class loaders in java :

  1. Bootstrap class loader
  2. Extension class loader
  3. 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. Continue reading

Nov 15

Java Glossary/ Dictionary-Letter C-part 6

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. Continue reading

Nov 08

Servlets Tutorial : Explain about http protocol in detail?

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. Continue reading

Nov 08

Servlets Tutorial : Important components of web application?

Explain the important components of Webapplication?

1) Browser

2) WebServer

3) DatabaseServer

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. Continue reading