Search This Blog

Tuesday 19 April 2011

Interface

Interface:
An interface in the java programing is an abstract type.
Interface can have variables and methods.
variables in interface are final,means the variables are constant,
and the methods dont have any definition.
An interface is declared as
interface interfacename
{
//variables
//method names with out any body definition
}
For an interface we cannot create any object for it.
If we want to create object we need to implement this interface through a class.
and the implemting class should all the methods in interface if not the class becomes abstract.
An interface can implement another interface also.


No comments:

Post a Comment