hi, please explain me the difference between interface and abstract also explain complete defination for interface. with regards, R.Balu Bangalore
R.Balu
Jane Griscti
Ranch Hand
Joined: Aug 30, 2000
Posts: 3141
posted
0
Hi Balu, An interface can declare constants and methods with no implementation code. Any class implementing an interface must provide code for each method defined in the interface. An abstract class can declare everything a regular class can as well as methods with no implementation code. For a more complete description of how an interface works see this post Hope that helps.
thanks to ur reply.it's realy helpful to me with regards, R.Balu Bangalore. india.
Ira Jain
Ranch Hand
Joined: Sep 06, 2000
Posts: 70
posted
0
Hi, I have created a list of differences between interfaces and abstract classes.It is : Difference between abstract class and interface----- Abstract Class Interface ----------------- ------------- -must not be instantiated -must not be instantiated -may contain static and final data -variables are implicitly static and final.The modifiers which can be used are public and final -abstract class can have non-abstract -methods are implicitly methods but, abstract method should be implemented in the be inside an abstract class. subclass which implements it.no method implementation strictly in the interface. -abstract method should not contain -methods in interface any of these keywords - private, should not contain any of final,static, native, synchronized. these - protected,private, final, static,native, synchronized . -methods are not implicitly public -methods are implicitly public even if not specified -is an incomplete class -specification or prescription for behavior -can extend only one parent class -can implement several interfaces atonce -can have constructors -interfaces can't (should contain body) have constructors -methods in it are given as- -methods in it are given as- public void amethod(){} public void amethod(); Hope it helps u Ira
Ira Jain
Ranch Hand
Joined: Sep 06, 2000
Posts: 70
posted
0
Looks like the list of differences did not come out Ok .So if you would still like to have it ,I'll email it to you at your mail id.