File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes abstract class and interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "abstract class and interface" Watch "abstract class and interface" New topic
Author

abstract class and interface

gunjan khanuja
Ranch Hand

Joined: Apr 16, 2012
Posts: 37
should an abstract class implementing an interface define all the methods of the interface??


Can a class implementing an interface overload the methods of the interface??
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

hi gunjan. An abstract method need not implement all or any methods of the interface . it can choose to implement all, some or none of the methods in the interface. and answer to your second question according to me is YES . you can overload the methods of the interface you are implementing in your class.
saloni jhanwar
Ranch Hand

Joined: Feb 09, 2012
Posts: 583

gunjan khanuja wrote:should an abstract class implementing an interface define all the methods of the interface??


It is not necessary to define interface methods in abstract class, however you can also do this there ,but if you don't do so then you have to define all undefined interface methods in first concrete class.(first subclass of abstract class)

gunjan khanuja wrote:Can a class implementing an interface overload the methods of the interface??


Yes, you can overload interface methods.


Tell the difficulties that i am difficult.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: abstract class and interface
 
Similar Threads
Interface vs AbstractClass
Extends java.text.Format
abstract class(all abstract methods) vs interface
Java interface
Constructor's in Interface. Why not ?