while implementing interface we need to take care 1)the implemented method shuld be public.since by default the interface are public and final.shall we able to mention it explicitly. 2)can the methods be overloaded or overridden
1)similar to that is there any rule that we need to take care while extending the abstract.what is the access modifier for the method in the abstract(by default). 2)can the methods be overloaded or overridden
==>Abstract class can define both abstract and non abstratc methods, an ==>interface can have only abstract methods. ==>Interface methods must not be static ==>Interface can declare only constants not instance variables. ==>Interace variables are cannot be either protected or Transient. ==>Interface methods are cannot be static or final ==>Abstract classes are cannot be marked as final ==>Abstract classes are cannot be instantiated
Raghu J<br />SCJP 1.4<br /> <br />The Wind and waters are always<br />on the side of the ablest navigators.<br /><a href="http://groups.yahoo.com/group/scjp_share" target="_blank" rel="nofollow">SCJP Group</a><br /><a href="http://groups.yahoo.com/group/JavaBeat_SCWCD" target="_blank" rel="nofollow">SCWCD Group</a>
1. Interface methods are public and abstract(not final) by default.u can also declare it explicitly.Even the interface can be declared abstract. 2.overriding and overloading is possible. abstract class 1.The abstract methods should not be declared private.It can have public,protected and default access. 2.The abstract methods can be overridden and overloaded. Hope this helps....