Java interface

23/04/2008

A java class containing all the methods as abstract is called an interface. A method that has no implementation and which is expected to be implemented by a subclass is called an abstract method. Java interface can contain constants. When an interface needs to be instantiated it should be implemented by a class and all its abstract methods should be defined. If all the methods are not implemented in the class then it becomes a java abstract class and so cannot be instantiated. Variables declared in a java interface by default is final.

is there other methods then abstract methods? would public, private, protected be another example of methods?

Anonymous on January 28th, 2011 4:25 pm

Hello Sir,
It’s all blogs are great. I have really got amazing information through this blogs would you please add some questions regarding to Struts and Hibernate. It will be really helpful.

Thanks again for all blogs….

Regards
Vishal S. Pawar

Vishal Pawar on April 15th, 2011 5:48 am

[...] an adapter is the travel power adapter. American socket and plug are different from British. Their interface are not compatible with one another. British plugs are cylindrical and American plugs are [...]

Adapter Pattern&hellip on May 7th, 2011 7:03 am

[...] start with an interface which creates a blue print for the class which will have decorators. Then implement that interface [...]

Decorator Pattern&hellip on May 17th, 2011 12:04 am

it is wonderful but give some examples

Anonymous on January 20th, 2012 10:08 am


Email:

about
I am Joe, author of this blog. I run this with loads of passion. If you are into java, you may find lot of interesting things around ...more about me. Google+
java badge
Home